aboutsummaryrefslogtreecommitdiff
path: root/lib/_tls_wrap.js
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2018-12-19 14:30:20 -0800
committerSam Roberts <vieuxtech@gmail.com>2018-12-28 12:57:29 -0800
commit59aa94112eb88176b60430e8e65436b7a55b270d (patch)
treec0d38e8fdfb7f5a2b091f6653f7bc7536a8aa52d /lib/_tls_wrap.js
parent08387b245ecfe5fb736d2d6753b880e644a4f3e2 (diff)
downloadandroid-node-v8-59aa94112eb88176b60430e8e65436b7a55b270d.tar.gz
android-node-v8-59aa94112eb88176b60430e8e65436b7a55b270d.tar.bz2
android-node-v8-59aa94112eb88176b60430e8e65436b7a55b270d.zip
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>
Diffstat (limited to 'lib/_tls_wrap.js')
-rw-r--r--lib/_tls_wrap.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js
index d2eb7befea..5c943f2cd6 100644
--- a/lib/_tls_wrap.js
+++ b/lib/_tls_wrap.js
@@ -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);
}