Fix socket.end() problem on non-empty queue
This commit is contained in:
parent
0b1214c16b
commit
544877d12e
@ -73,7 +73,9 @@ IOWatcher.prototype.ondrain = function () {
|
|||||||
|
|
||||||
IOWatcher.prototype.onerror = function (errno) {
|
IOWatcher.prototype.onerror = function (errno) {
|
||||||
assert(this.socket);
|
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;
|
this._eof = true;
|
||||||
|
|
||||||
// If this isn't in the dumpQueue then we shutdown now.
|
// If this isn't in the dumpQueue then we shutdown now.
|
||||||
if (!this._writeWatcher.next) this._shutdown();
|
if (!this._writeWatcher.firstBucket) this._shutdown();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user