summaryrefslogtreecommitdiff
path: root/lib/net.js
diff options
context:
space:
mode:
authorRobert Nagy <ronagy@icloud.com>2019-08-17 13:08:09 +0200
committerRich Trott <rtrott@gmail.com>2019-08-19 19:11:12 -0700
commitcc7cec25c5fc2fdb8e055e25162c4b231f19e287 (patch)
treeb771c6688d0da0a47e085b60caa686502cd6068b /lib/net.js
parent490ec9b9c9422c8975c1613709c13f64db2f7d0f (diff)
downloadandroid-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.js2
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;
}