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