From e1250a3333d22f003b37f66978a856e1f7ec96db Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 12 Nov 2010 09:18:44 -0800 Subject: [PATCH] Reset _eof on socket reuse --- lib/http.js | 2 +- lib/net.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/http.js b/lib/http.js index 1a00efce83b..70585ca810e 100644 --- a/lib/http.js +++ b/lib/http.js @@ -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(); } diff --git a/lib/net.js b/lib/net.js index cd83b157207..59af9b9f321 100644 --- a/lib/net.js +++ b/lib/net.js @@ -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();