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 897114b

Browse filesBrowse files
addaleaxMylesBorins
authored andcommitted
net: partially revert "simplify Socket.prototype._final"
Partially revert b7e6ccd because it broke a test that was added since its last CI run. Refs: #24075 Refs: #23866 PR-URL: #24288 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
1 parent 704b68a commit 897114b
Copy full SHA for 897114b

File tree

Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Open diff view settings
Collapse file

‎lib/net.js‎

Copy file name to clipboardExpand all lines: lib/net.js
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,12 @@ Socket.prototype._final = function(cb) {
344344
return this.once('connect', () => this._final(cb));
345345
}
346346

347+
// TODO(addaleax): This should not be necessary.
348+
if (!this.readable || this._readableState.ended) {
349+
cb();
350+
return this.destroy();
351+
}
352+
347353
if (!this._handle)
348354
return cb();
349355

0 commit comments

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