tls: don't shadow the tls global with a local
`tls` shadows the global `tls` require, and isn't indicative of the arument type. PR-URL: https://github.com/nodejs/node/pull/25861 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
parent
24ea4a3452
commit
ddd6c21046
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user