diff options
author | Robert Nagy <ronagy@icloud.com> | 2019-08-17 13:08:09 +0200 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-08-19 19:11:12 -0700 |
commit | cc7cec25c5fc2fdb8e055e25162c4b231f19e287 (patch) | |
tree | b771c6688d0da0a47e085b60caa686502cd6068b /lib/net.js | |
parent | 490ec9b9c9422c8975c1613709c13f64db2f7d0f (diff) | |
download | android-node-v8-cc7cec25c5fc2fdb8e055e25162c4b231f19e287.tar.gz android-node-v8-cc7cec25c5fc2fdb8e055e25162c4b231f19e287.tar.bz2 android-node-v8-cc7cec25c5fc2fdb8e055e25162c4b231f19e287.zip |
net: use callback to properly propagate error
The socket will be destroyed upstream through the proper error
flow.
PR-URL: https://github.com/nodejs/node/pull/29178
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/net.js')
-rw-r--r-- | lib/net.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/net.js b/lib/net.js index 09e34f75bd..2b099d75ef 100644 --- a/lib/net.js +++ b/lib/net.js @@ -685,7 +685,7 @@ Socket.prototype._writeGeneric = function(writev, data, encoding, cb) { this._pendingEncoding = ''; if (!this._handle) { - this.destroy(new ERR_SOCKET_CLOSED(), cb); + cb(new ERR_SOCKET_CLOSED()); return false; } |