From 0011c68b55f36f1c422ab44163d6947c8e25ef50 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Sun, 22 Mar 2015 01:12:07 -0700 Subject: [PATCH] fix --- lib/_stream_writable.js | 2 +- lib/net.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index cd0cf1f2531ece..1ec8a18c7c25fc 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -486,7 +486,7 @@ function finishMaybe(stream, state) { if (need) { if (state.pendingcb === 0) { prefinish(stream, state); - stream.flushed = true; + state.flushed = true; state._end(stream, function(err) { if (err) stream.emit('error', err); diff --git a/lib/net.js b/lib/net.js index 528087c814595e..cfdc737621f19b 100644 --- a/lib/net.js +++ b/lib/net.js @@ -883,6 +883,7 @@ Socket.prototype.connect = function(options, cb) { this._readableState.endEmitted = false; this._writableState.ended = false; this._writableState.ending = false; + this._writableState.flushed = false; this._writableState.finished = false; this._writableState.errorEmitted = false; this.destroyed = false;