tls: fix initRead socket argument name

"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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Sam Roberts 2018-12-19 14:30:20 -08:00
parent 08387b245e
commit 59aa94112e

View File

@ -271,15 +271,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 (!tls._handle)
return;
// Socket already has some buffered data - emulate receiving it
if (wrapped && wrapped.readableLength) {
if (socket && socket.readableLength) {
var buf;
while ((buf = wrapped.read()) !== null)
while ((buf = socket.read()) !== null)
tls._handle.receive(buf);
}