diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 43947bb8c68b91..cefd321edaf3cc 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -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); } /**