Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: emit 'close' when socket ends before connect #21290

Commits on Jun 12, 2018

  1. 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
    9b7a691, 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: nodejs#21290
    Fixes: nodejs#21268
    Brett Kiefer committed Jun 12, 2018
    Configuration menu
    Copy the full SHA
    ce82fa6 View commit details
    Browse the repository at this point in the history