Fix socket.end() problem on non-empty queue

v0.7.4-release
Ryan Dahl 2010-11-18 11:59:15 -08:00
parent 0b1214c16b
commit 544877d12e
1 changed files with 4 additions and 2 deletions

View File

@ -73,7 +73,9 @@ IOWatcher.prototype.ondrain = function () {
IOWatcher.prototype.onerror = function (errno) {
assert(this.socket);
this.socket.destroy(errnoException(errno, 'write'));
var e = errnoException(errno, 'write');
e.message += " fd=" + this.socket.fd;
this.socket.destroy(e);
};
@ -613,7 +615,7 @@ Stream.prototype.end = function (data, encoding) {
this._eof = true;
// If this isn't in the dumpQueue then we shutdown now.
if (!this._writeWatcher.next) this._shutdown();
if (!this._writeWatcher.firstBucket) this._shutdown();
};