Skip to content

Commit

Permalink
Correctly return from Stream.write()
Browse files Browse the repository at this point in the history
In some cases, the attempt to flush the writeQueue might be successful,
meaning that the queueSize is in fact 0, but the captured size *prior*
to the flush was large enough to return false.

Read the current queueSize when deciding to return false from write().
  • Loading branch information
isaacs authored and ry committed Nov 30, 2010
1 parent f7f802e commit eca56e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/net.js
Expand Up @@ -285,7 +285,7 @@ Stream.prototype.write = function (data, encoding, fd) {
IOWatcher.flush();
}

return queueSize < (64*1024);
return this._writeWatcher.queueSize > (64*1024);
};


Expand Down

0 comments on commit eca56e5

Please sign in to comment.