Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2ddbbfd

Browse filesBrowse files
indutnyjasnell
authored andcommitted
http: cork/uncork before flushing pipelined res
Make sure that the pipelined response data will be written as less TCP packets as possible. PR-URL: #3172 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
1 parent 660f759 commit 2ddbbfd
Copy full SHA for 2ddbbfd

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Open diff view settings
Collapse file

‎lib/_http_outgoing.js‎

Copy file name to clipboardExpand all lines: lib/_http_outgoing.js
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,12 @@ OutgoingMessage.prototype._writeRaw = function(data, encoding, callback) {
157157
var output = this.output;
158158
var outputEncodings = this.outputEncodings;
159159
var outputCallbacks = this.outputCallbacks;
160+
connection.cork();
160161
for (var i = 0; i < outputLength; i++) {
161162
connection.write(output[i], outputEncodings[i],
162163
outputCallbacks[i]);
163164
}
165+
connection.uncork();
164166

165167
this.output = [];
166168
this.outputEncodings = [];
@@ -637,10 +639,12 @@ OutgoingMessage.prototype._flush = function() {
637639
var output = this.output;
638640
var outputEncodings = this.outputEncodings;
639641
var outputCallbacks = this.outputCallbacks;
642+
socket.cork();
640643
for (var i = 0; i < outputLength; i++) {
641644
ret = socket.write(output[i], outputEncodings[i],
642645
outputCallbacks[i]);
643646
}
647+
socket.uncork();
644648

645649
this.output = [];
646650
this.outputEncodings = [];

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.