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>
This commit is contained in:
parent
490ec9b9c9
commit
cc7cec25c5
@ -685,7 +685,7 @@ Socket.prototype._writeGeneric = function(writev, data, encoding, cb) {
|
|||||||
this._pendingEncoding = '';
|
this._pendingEncoding = '';
|
||||||
|
|
||||||
if (!this._handle) {
|
if (!this._handle) {
|
||||||
this.destroy(new ERR_SOCKET_CLOSED(), cb);
|
cb(new ERR_SOCKET_CLOSED());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user