diff options
author | Luigi Pinca <luigipinca@gmail.com> | 2018-03-08 22:47:55 +0100 |
---|---|---|
committer | Luigi Pinca <luigipinca@gmail.com> | 2018-03-21 18:28:16 +0100 |
commit | 9b7a6914a7f0bd754e78b42b48c75851cfd6b3c4 (patch) | |
tree | 4991014b64d44d4db98bba76f2fc3451e0f9fd3d /test/parallel/test-tls-tlswrap-segfault.js | |
parent | 74553465e6c450a3777c27f9cd3bd209a3726eda (diff) | |
download | node-new-9b7a6914a7f0bd754e78b42b48c75851cfd6b3c4.tar.gz |
net: emit 'close' after 'end'
Currently the writable side of the socket is closed as soon as `UV_EOF`
is read regardless of the state of the socket. This allows the handle
to be closed before `'end'` is emitted and thus `'close'` can be
emitted before `'end'` if the socket is paused.
This commit prevents the handle from being closed until `'end'` is
emitted ensuring the correct order of events.
PR-URL: https://github.com/nodejs/node/pull/19241
Fixes: https://github.com/nodejs/node/issues/19166
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'test/parallel/test-tls-tlswrap-segfault.js')
-rw-r--r-- | test/parallel/test-tls-tlswrap-segfault.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/parallel/test-tls-tlswrap-segfault.js b/test/parallel/test-tls-tlswrap-segfault.js index eaa51ff51b..a36016efa4 100644 --- a/test/parallel/test-tls-tlswrap-segfault.js +++ b/test/parallel/test-tls-tlswrap-segfault.js @@ -26,6 +26,7 @@ const server = tls.createServer(options, function(s) { const client = tls.connect(opts, function() { putImmediate(client); }); + client.resume(); }); function putImmediate(client) { |