Fix bug in socket write optimization
Thanks to tlb@tlb.org for finding it!
This commit is contained in:
parent
c7b3c1ecbc
commit
e235aae018
@ -624,7 +624,12 @@ Stream.prototype._writeOut = function (data, encoding) {
|
|||||||
|
|
||||||
if (bytesWritten == len) {
|
if (bytesWritten == len) {
|
||||||
// awesome. sent to buffer.
|
// 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) {
|
if (queuedData) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user