mirror of https://github.com/nodejs/node.git
net_uv: Handle failed shutdown req
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