Skip to content

Commit

Permalink
Update client.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nasss committed Apr 24, 2013
1 parent b0899e7 commit 64e5ff2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions client.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ client.setLogLevel = function(level) {
request.logger.setLevel(level);
}


client.protocolSpdyVersion = 3;

//
Expand All @@ -41,7 +40,6 @@ client.get = function(options, callback) {
return client.request(_options, callback);
}


//
// ### function getConnection (host, port, plain)
// #### @host {String} server host
Expand All @@ -54,7 +52,8 @@ client.getConnection = function(host, port, plain) {
var conn = this.connections[key];
if (conn == null) {
/* create a connection */
var conn = new connection.ClientSpdyConnection(host, port, plain, client.protocolSpdyVersion);
var conn = new connection.ClientSpdyConnection(host, port, plain,
client.protocolSpdyVersion);
/* add it to the stack */
this.connections[key] = conn;
}
Expand All @@ -75,8 +74,9 @@ client.request = function(options, callback) {
var spdyConnection = this.getConnection(options.host, options.port,
options.plain);
/* Do not create new streams after GOAWAY */
if (spdyConnection.goAway) return;

if (spdyConnection.goAway)
return;

/* second, push the request to the spdy connection */
return spdyConnection.startRequest(options, callback);
}
Expand All @@ -90,7 +90,8 @@ client.request = function(options, callback) {
client.ping = function(options, callback) {
var conn = this.getConnection(options.host, options.port, options.plain);
/* Do not create new streams after GOAWAY */
if (conn.goAway) return;
if (conn.goAway)
return;
if (callback) {
conn.addListener('ping', callback);
}
Expand Down

0 comments on commit 64e5ff2

Please sign in to comment.