Uh oh!
There was an error while loading. Please reload this page.
net: check for close on stream, not parent - #25026
Conversation
'close' event isn't emitted on a TLS connection if it's been written to (but 'end' and 'finish' events are). Fixes: #24984
| }; | ||
| function afterShutdown(status, handle) { |
There was a problem hiding this comment.
Do you know why this gets called with the wrong handle?
There was a problem hiding this comment.
It comes from here: https://github.com/nodejs/node/blob/v11.4.0/src/stream_base.cc#L383
This in turn is set by https://github.com/nodejs/node/blob/v11.4.0/src/stream_base-inl.h#L86
which is called by https://github.com/nodejs/node/blob/v11.4.0/src/tls_wrap.cc#L73
TLSWrap's stream is the external stream from here: https://github.com/nodejs/node/blob/v11.4.0/lib/_tls_wrap.js#L423
which is the unencrypted socket passed into the constructor: https://github.com/nodejs/node/blob/v11.4.0/lib/_tls_wrap.js#311
In summary, it gets the underlying socket's stream rather than the encrypted stream (TLSSocket). Node stream operations appear to be performed on TLSSocket only.
addaleax
commented
Dec 15, 2018
danbev
commented
Dec 19, 2018
Re-run of CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1694/ |
davedoesdev
commented
Dec 20, 2018
Do I need to do anything about the CITGM? They look like compile failures. |
lpinca
commented
Dec 26, 2018
Landed in 86e2ec4. |
'close' event isn't emitted on a TLS connection if it's been written to (but 'end' and 'finish' events are). PR-URL: nodejs#25026Fixes: nodejs#24984 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
'close' event isn't emitted on a TLS connection if it's been written to (but 'end' and 'finish' events are). PR-URL: nodejs#25026Fixes: nodejs#24984 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
afterShutdownwas checking parent stream rather than TLS streamFixes#24984
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes