From c84b4204571e8f87fae300e4ab331e688912fb10 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 10 Nov 2018 21:03:46 +0100 Subject: [PATCH] Revert "net: partially revert "simplify Socket.prototype._final"" This reverts commit ac1f56c76a5d1a8ebcb2421d5c629e51df1ac48c. 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 Reviewed-By: Daniel Bevenius Reviewed-By: Ouyang Yadong --- lib/net.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/net.js b/lib/net.js index 190f40c38f78b6..d21040198de631 100644 --- a/lib/net.js +++ b/lib/net.js @@ -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();