summaryrefslogtreecommitdiff
path: root/lib/http2.js
diff options
context:
space:
mode:
authorMikeal Rogers <mikeal.rogers@gmail.com>2011-08-15 13:51:20 -0700
committerRyan Dahl <ry@tinyclouds.org>2011-08-22 14:31:25 -0700
commit103990b64043b980cf98feefcae12019ae6e3108 (patch)
tree8ee525109e872355c38df2da6b5cd251c5d44a01 /lib/http2.js
parent94963ab39adcf4b346646f9a4bb5cd3dbf09dac6 (diff)
downloadandroid-node-v8-103990b64043b980cf98feefcae12019ae6e3108.tar.gz
android-node-v8-103990b64043b980cf98feefcae12019ae6e3108.tar.bz2
android-node-v8-103990b64043b980cf98feefcae12019ae6e3108.zip
Fixes #1531
Diffstat (limited to 'lib/http2.js')
-rw-r--r--lib/http2.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/http2.js b/lib/http2.js
index 5196dfca66..716a7810b3 100644
--- a/lib/http2.js
+++ b/lib/http2.js
@@ -929,7 +929,7 @@ Agent.prototype.addRequest = function(req, host, port) {
};
Agent.prototype.createSocket = function(name, host, port) {
var self = this;
- var s = self.createConnection(port, host);
+ var s = self.createConnection(port, host, self.options);
if (!self.sockets[name]) {
self.sockets[name] = [];
}
@@ -1027,7 +1027,11 @@ function ClientRequest(options, cb) {
if (self.socketPath) {
self._last = true;
self.shouldKeepAlive = false;
- self.onSocket(net.createConnection(self.socketPath));
+ if (options.createConnection) {
+ self.onSocket(options.createConnection(self.socketPath));
+ } else {
+ self.onSocket(net.createConnection(self.socketPath));
+ }
} else if (self.agent) {
// If there is an agent we should default to Connection:keep-alive.
self._last = false;
@@ -1037,7 +1041,11 @@ function ClientRequest(options, cb) {
// No agent, default to Connection:close.
self._last = true;
self.shouldKeepAlive = false;
- self.onSocket(net.createConnection(options.port, options.host));
+ if (options.createConnection) {
+ self.onSocket(options.createConnection(options.port, options.host, options));
+ } else {
+ self.onSocket(net.createConnection(options.port, options.host));
+ }
}
self._deferToConnect(null, null, function () {