summaryrefslogtreecommitdiffstats
path: root/net/http/http_stream_request.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/http/http_stream_request.cc')
-rw-r--r--net/http/http_stream_request.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/net/http/http_stream_request.cc b/net/http/http_stream_request.cc
index 59a7e8c..35832c7 100644
--- a/net/http/http_stream_request.cc
+++ b/net/http/http_stream_request.cc
@@ -422,7 +422,18 @@ int HttpStreamRequest::DoResolveProxyComplete(int result) {
return ERR_NO_SUPPORTED_PROXIES;
}
- next_state_ = STATE_INIT_CONNECTION;
+ HostPortProxyPair pair(endpoint_, proxy_info()->proxy_server());
+ if (!factory_->create_new_spdy_session_for_http() &&
+ alternate_protocol_mode_ == kUsingAlternateProtocol &&
+ !session_->spdy_session_pool()->HasSession(pair)) {
+ // If we don't already have a SpdySession, then don't pay the SSL handshake
+ // cost of setup. Just use HTTP.
+ next_state_ = STATE_RESOLVE_PROXY;
+ alternate_protocol_mode_ = kDoNotUseAlternateProtocol;
+ } else {
+ next_state_ = STATE_INIT_CONNECTION;
+ }
+
return OK;
}