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 committed Feb 5, 2019
1 parent 24ea4a3 commit ddd6c21
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 @@ -280,19 +280,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 ddd6c21

Please sign in to comment.