projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c7b3c1e
)
Fix bug in socket write optimization
author
Ryan Dahl
<ry@tinyclouds.org>
Tue, 27 Apr 2010 03:26:43 +0000
(20:26 -0700)
committer
Ryan Dahl
<ry@tinyclouds.org>
Tue, 27 Apr 2010 03:26:43 +0000
(20:26 -0700)
Thanks to tlb@tlb.org for finding it!
lib/net.js
patch
|
blob
|
history
diff --git
a/lib/net.js
b/lib/net.js
index
be49783
..
04ca00f
100644
(file)
--- 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 {