summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/_stream_writable.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js
index 020d7abcc0..90aa285865 100644
--- a/lib/_stream_writable.js
+++ b/lib/_stream_writable.js
@@ -71,13 +71,13 @@ Writable.prototype.write = function(chunk, encoding) {
if (typeof chunk === 'string')
chunk = new Buffer(chunk, encoding);
- var ret = state.length >= state.highWaterMark;
- if (ret === false)
- state.needDrain = true;
-
var l = chunk.length;
state.length += l;
+ var ret = state.length < state.highWaterMark;
+ if (ret === false)
+ state.needDrain = true;
+
if (state.writing) {
state.buffer.push(chunk);
return ret;