Browse Source

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

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
544877d12e
  1. 6
      lib/net.js

6
lib/net.js

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

Loading…
Cancel
Save