summaryrefslogtreecommitdiff
path: root/test/parallel/test-net-server-connections-child-null.js
diff options
context:
space:
mode:
authorLuigi Pinca <luigipinca@gmail.com>2018-03-08 22:47:55 +0100
committerLuigi Pinca <luigipinca@gmail.com>2018-03-21 18:28:16 +0100
commit9b7a6914a7f0bd754e78b42b48c75851cfd6b3c4 (patch)
tree4991014b64d44d4db98bba76f2fc3451e0f9fd3d /test/parallel/test-net-server-connections-child-null.js
parent74553465e6c450a3777c27f9cd3bd209a3726eda (diff)
downloadnode-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-net-server-connections-child-null.js')
-rw-r--r--test/parallel/test-net-server-connections-child-null.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/parallel/test-net-server-connections-child-null.js b/test/parallel/test-net-server-connections-child-null.js
index cbe2d22052..46084404c8 100644
--- a/test/parallel/test-net-server-connections-child-null.js
+++ b/test/parallel/test-net-server-connections-child-null.js
@@ -37,6 +37,8 @@ if (process.argv[2] === 'child') {
assert.strictEqual(server.connections, null);
server.close();
}));
+
+ connect.resume();
}));
});