diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-10-10 02:22:38 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-10-12 03:09:22 +0200 |
commit | 1447a79dc435578bffba32ead9b2ffa0425fc30a (patch) | |
tree | e79feecc8c7a968981882c4d023a41723c874944 /lib | |
parent | aca1c283bd8c6778b477286b8516f7c38dc9cefb (diff) | |
download | android-node-v8-1447a79dc435578bffba32ead9b2ffa0425fc30a.tar.gz android-node-v8-1447a79dc435578bffba32ead9b2ffa0425fc30a.tar.bz2 android-node-v8-1447a79dc435578bffba32ead9b2ffa0425fc30a.zip |
net: treat ENOTCONN at shutdown as success
While it is not entirely clear why this condition is being
triggered, it does resolve a reported bug.
Fixes: https://github.com/nodejs/node/issues/26315
PR-URL: https://github.com/nodejs/node/pull/29912
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/net.js b/lib/net.js index baaf2180d1..c0d2576afc 100644 --- a/lib/net.js +++ b/lib/net.js @@ -39,7 +39,8 @@ const { const assert = require('internal/assert'); const { UV_EADDRINUSE, - UV_EINVAL + UV_EINVAL, + UV_ENOTCONN } = internalBinding('uv'); const { Buffer } = require('buffer'); @@ -403,7 +404,7 @@ Socket.prototype._final = function(cb) { req.callback = cb; const err = this._handle.shutdown(req); - if (err === 1) // synchronous finish + if (err === 1 || err === UV_ENOTCONN) // synchronous finish return afterShutdown.call(req, 0); else if (err !== 0) return this.destroy(errnoException(err, 'shutdown')); |