Skip to content

Commit 302519f

Browse files
committed
freebsd fix attempt #2
1 parent 24ac417 commit 302519f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/_http_outgoing.js

+2
Original file line numberDiff line numberDiff line change
@@ -579,10 +579,12 @@ OutgoingMessage.prototype._onPrefinish = function() {
579579
if (!socket || !socket.writable || socket.destroyed)
580580
return;
581581

582+
socket.cork();
582583
this._sendHeaders();
583584

584585
if (this._hasBody && this.chunkedEncoding)
585586
socket.write('0\r\n' + this._trailer + '\r\n', 'binary');
587+
socket.uncork();
586588
};
587589

588590

test/parallel/test-http-1.0-keep-alive.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ function check(tests) {
120120
function ondata(s) {
121121
console.error(' > CLIENT ONDATA %j %j', s.length, s.toString());
122122
current++;
123-
conn.removeListener('data', ondata);
124123
if (ctx.expectClose) return;
124+
conn.removeListener('data', ondata);
125125
conn.removeListener('close', onclose);
126126
connected();
127127
}

0 commit comments

Comments
 (0)