Skip to content

Commit

Permalink
tls: fix initRead socket argument name
Browse files Browse the repository at this point in the history
"wrapped" argument is the caller's "socket", not its "wrap", and its
referred to as "socket" in the comments, so call it that.

PR-URL: #25153
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
  • Loading branch information
sam-github authored and targos committed Jan 1, 2019
1 parent acf7802 commit d5ba121
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/_tls_wrap.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -269,15 +269,17 @@ function onerror(err) {
} }
} }


function initRead(tls, wrapped) { // 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) {
// If we were destroyed already don't bother reading // If we were destroyed already don't bother reading
if (!tls._handle) if (!tls._handle)
return; return;


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


Expand Down

0 comments on commit d5ba121

Please sign in to comment.