0
0
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:
Ryan Dahl 2011-08-10 14:09:21 -07:00
parent c171a0851a
commit 72c412767d

View File

@ -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;
};