Browse Source

net_uv: Handle failed shutdown req

v0.7.4-release
Ryan Dahl 13 years ago
parent
commit
72c412767d
  1. 9
      lib/net_uv.js

9
lib/net_uv.js

@ -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…
Cancel
Save