summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2013-04-08 16:40:21 +0400
committerFedor Indutny <fedor.indutny@gmail.com>2013-04-27 21:03:40 +0400
commitdf8a4f8f07cf274c6c9fae50e175879d6a1dc139 (patch)
treeccc09620ce10a3fbb6b67482c0c8d4adaf1d07c2 /lib
parent60ed2c5434d893fccd3702d288c2ba2ab325805a (diff)
downloadandroid-node-v8-df8a4f8f07cf274c6c9fae50e175879d6a1dc139.tar.gz
android-node-v8-df8a4f8f07cf274c6c9fae50e175879d6a1dc139.tar.bz2
android-node-v8-df8a4f8f07cf274c6c9fae50e175879d6a1dc139.zip
http: write buffers when chunked to embrace writev
Diffstat (limited to 'lib')
-rw-r--r--lib/_http_outgoing.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js
index 055f6491b3..8edc8666de 100644
--- a/lib/_http_outgoing.js
+++ b/lib/_http_outgoing.js
@@ -413,9 +413,15 @@ OutgoingMessage.prototype.write = function(chunk, encoding) {
} else {
// buffer, or a non-toString-friendly encoding
len = chunk.length;
- this._send(len.toString(16) + CRLF);
- this._send(chunk, encoding);
- ret = this._send(CRLF);
+
+ if (this.connection)
+ this.connection.cork();
+ this._send(len.toString(16));
+ this._send(crlf_buf);
+ this._send(chunk);
+ ret = this._send(crlf_buf);
+ if (this.connection)
+ this.connection.uncork();
}
} else {
ret = this._send(chunk, encoding);