diff --git a/lib/net.js b/lib/net.js index be49783f23..04ca00f174 100644 --- a/lib/net.js +++ b/lib/net.js @@ -624,7 +624,12 @@ Stream.prototype._writeOut = function (data, encoding) { if (bytesWritten == len) { // awesome. sent to buffer. - buffer.used -= len; // Optimization - save the space + if (buffer === pool) { + // If we're just writing from the pool then we can make a little + // optimization and save the space. + buffer.used -= len; + } + if (queuedData) { return false; } else {