Unverified Commit 517955a4 authored by Ouyang Yadong's avatar Ouyang Yadong Committed by Anna Henningsen
Browse files

tls: close StreamWrap and its stream correctly

When sockets of the "net" module destroyed, they will call
`this._handle.close()` which will also emit EOF if not emitted
before. This feature makes sockets on the other side emit "end" and
"close" even though we haven't called `end()`. As `stream` of
`StreamWrap` are likely to be instances of `net.Socket`, calling
`destroy()` manually will avoid issues that don't properly close
wrapped connections.

Fixes: https://github.com/nodejs/node/issues/14605

PR-URL: https://github.com/nodejs/node/pull/23654


Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent beb0f03e
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment