mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
Revert "net: partially revert "simplify Socket.prototype._final""
This reverts commit ac1f56c76a.
Refs: https://github.com/nodejs/node/pull/24288
Refs: https://github.com/nodejs/node/pull/24075
PR-URL: https://github.com/nodejs/node/pull/24290
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com>
This commit is contained in:
1 parent
0f6a9524f8
commit
c84b420457
1 file changed
-6
@@ -349,12 +349,6 @@ 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();
|
||||
|
||||
|
||||
Reference in new issue
Block a user