★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/897114bf94Nouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files

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>
  • Loading branch information...
addaleax authored and MylesBorins committed Nov 10, 2018
1 parent 704b68a commit 897114bf94cc80ef2e55daaa306f38f2fbb81020
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/net.js
@@ -344,6 +344,12 @@ Socket.prototype._final = function(cb) {
return this.once('connect', () => this._final(cb));
}

// TODO(addaleax): This should not be necessary.
if (!this.readable || this._readableState.ended) {
cb();
return this.destroy();
}

if (!this._handle)
return cb();

0 comments on commit 897114b

Please sign in to comment.
You can’t perform that action at this time.