Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit da58301

Browse filesBrowse files
committed
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: #26315 PR-URL: #29912 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent d9174b4 commit da58301
Copy full SHA for da58301

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Open diff view settings
Collapse file

‎lib/net.js‎

Copy file name to clipboardExpand all lines: lib/net.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ const {
3939
const assert = require('internal/assert');
4040
const {
4141
UV_EADDRINUSE,
42-
UV_EINVAL
42+
UV_EINVAL,
43+
UV_ENOTCONN
4344
} = internalBinding('uv');
4445

4546
const { Buffer } = require('buffer');
@@ -403,7 +404,7 @@ Socket.prototype._final = function(cb) {
403404
req.callback = cb;
404405
const err = this._handle.shutdown(req);
405406

406-
if (err === 1) // synchronous finish
407+
if (err === 1 || err === UV_ENOTCONN) // synchronous finish
407408
return afterShutdown.call(req, 0);
408409
else if (err !== 0)
409410
return this.destroy(errnoException(err, 'shutdown'));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.