mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
net_uv: Handle failed shutdown req
This commit is contained in:
parent
c171a0851a
commit
72c412767d
@ -171,6 +171,7 @@ Socket.prototype.end = function(data, encoding) {
|
||||
this.writable = false;
|
||||
this._flags |= FLAG_SHUTDOWNQUED;
|
||||
}
|
||||
|
||||
if (!this.writable) return;
|
||||
this.writable = false;
|
||||
|
||||
@ -182,8 +183,16 @@ Socket.prototype.end = function(data, encoding) {
|
||||
} else {
|
||||
this._flags |= FLAG_SHUTDOWN;
|
||||
var shutdownReq = this._handle.shutdown();
|
||||
|
||||
if (!shutdownReq) {
|
||||
this.destroy(errnoException(errno, 'shutdown'));
|
||||
return false;
|
||||
}
|
||||
|
||||
shutdownReq.oncomplete = afterShutdown;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user