Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tls: don't shadow the tls global with a local
`tls` shadows the global `tls` require, and isn't indicative of the
arument type.
  • Loading branch information
sam-github committed Feb 1, 2019
commit 25b6406403645329a561450946c9de9191dfd204
8 changes: 4 additions & 4 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,19 +273,19 @@ function onerror(err) {

// Used by both client and server TLSSockets to start data flowing from _handle,
// read(0) causes a StreamBase::ReadStart, via Socket._read.
function initRead(tls, socket) {
function initRead(tlsSocket, socket) {
// If we were destroyed already don't bother reading
if (!tls._handle)
if (!tlsSocket._handle)
return;

// Socket already has some buffered data - emulate receiving it
if (socket && socket.readableLength) {
var buf;
while ((buf = socket.read()) !== null)
tls._handle.receive(buf);
tlsSocket._handle.receive(buf);
}

tls.read(0);
tlsSocket.read(0);
}

/**
Expand Down