Files
node/test/parallel
Brett Kiefer 18c057ab26 net: emit 'close' when socket ends before connect
Don't set `writable` to true when a socket connects if the socket is
already in an ending state.

In the existing code, afterConnect always set `writable` to true.  This
has been the case for a long time, but previous to commit
9b7a6914a7, the socket would still be
destroyed by `destroySoon` and emit a `'close'` event. Since that
commit removed this masking behavior, we have relied on maybeDestroy to
destroy the socket when the readble state is ended, and that won't
happen if `writable` is set to true.

If the socket has `allowHalfOpen` set to true, then `destroy` will still
not be called and `'close'` will not be emitted.

PR-URL: https://github.com/nodejs/node/pull/21290
Fixes: https://github.com/nodejs/node/issues/21268
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-06-19 08:59:44 +02:00
..
2018-02-16 16:54:07 +01:00
2018-02-16 16:54:07 +01:00
2018-02-16 16:54:07 +01:00
2018-03-25 01:45:40 +01:00
2018-03-25 01:45:40 +01:00
2018-03-25 01:45:40 +01:00
2017-12-22 12:49:10 -08:00
2018-05-29 13:55:58 +02:00
2018-02-01 13:17:33 +01:00
2018-03-25 01:45:40 +01:00
2018-03-25 01:45:40 +01:00
2018-03-25 01:45:40 +01:00
2018-05-22 14:24:32 -04:00
2018-02-16 16:54:07 +01:00
2018-03-25 01:45:38 +01:00
2018-02-16 16:54:07 +01:00
2018-06-06 10:31:28 +02:00
2018-06-13 08:41:48 +02:00
2018-06-13 08:41:48 +02:00
2018-02-16 16:54:07 +01:00
2018-01-30 17:00:57 -08:00
2018-01-30 17:00:57 -08:00