Skip to content

Commit

Permalink
tls: don't shadow the tls global with a local
Browse files Browse the repository at this point in the history
`tls` shadows the global `tls` require, and isn't indicative of the
arument type.

PR-URL: #25861
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
sam-github authored and addaleax committed Feb 6, 2019
1 parent b5a8376 commit 4d0b56f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,19 +277,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

0 comments on commit 4d0b56f

Please sign in to comment.