Reset _eof on socket reuse

v0.7.4-release
Ryan Dahl 2010-11-12 09:18:44 -08:00
parent 5ba0be6166
commit e1250a3333
2 changed files with 3 additions and 2 deletions

View File

@ -828,7 +828,7 @@ function connectionListener (socket) {
// HACK: need way to do this with socket interface
if (socket._writeWatcher.firstBucket) {
socket._eof = true;
socket.__destroyOnDrain = true;
} else {
socket.destroy();
}

View File

@ -160,6 +160,7 @@ function initStream (self) {
self._readWatcher.socket = self;
self._readWatcher.callback = onReadable;
self.readable = false;
self._eof = false;
self._writeWatcher = ioWatchers.alloc();
self._writeWatcher.socket = self;
@ -498,7 +499,7 @@ Stream.prototype.destroy = function (exception) {
// pool is shared between sockets, so don't need to free it here.
var self = this;
this.readable = this.writable = false;
this._eof = this.readable = this.writable = false;
if (this._writeWatcher) {
this._writeWatcher.stop();