diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-19 21:39:26 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-19 21:39:26 +0000 |
commit | 87f64d0a3a65d18ad5360e9326e303079bab2fb0 (patch) | |
tree | 47428ed5c192b0d539981c447d5013ac72e74cae /net/http | |
parent | 6fe3a50a9165ad5ef722c82749ec6cfc0d1f26cc (diff) | |
download | chromium_src-87f64d0a3a65d18ad5360e9326e303079bab2fb0.zip chromium_src-87f64d0a3a65d18ad5360e9326e303079bab2fb0.tar.gz chromium_src-87f64d0a3a65d18ad5360e9326e303079bab2fb0.tar.bz2 |
SPDY: Change Chrome code to support new NPN protocols.
Review URL: http://codereview.chromium.org/1575048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44961 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_network_layer.cc | 9 | ||||
-rw-r--r-- | net/http/http_network_transaction.cc | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc index 8a22514..4915cd1 100644 --- a/net/http/http_network_layer.cc +++ b/net/http/http_network_layer.cc @@ -136,7 +136,14 @@ void HttpNetworkLayer::EnableSpdy(const std::string& mode) { } else if (option == kDisableCompression) { spdy::SpdyFramer::set_enable_compression_default(false); } else if (option == kEnableNPN) { - HttpNetworkTransaction::SetNextProtos("\007http1.1\004spdy"); + // Except for the first element, the order is irrelevant. First element + // specifies the fallback in case nothing matches + // (SSLClientSocket::kNextProtoNoOverlap). Otherwise, the SSL library + // will choose the first overlapping protocol in the server's list, since + // it presumedly has a better understanding of which protocol we should + // use, therefore the rest of the ordering here is not important. + HttpNetworkTransaction::SetNextProtos( + "\008http/1.1\007http1.1\006spdy/1\004spdy"); force_spdy_ = false; } else if (option.empty() && it == spdy_options.begin()) { continue; diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 9c4d0f9..0144316 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -870,9 +870,9 @@ int HttpNetworkTransaction::DoSSLConnectComplete(int result) { // here, then we know that we called SSL_ImportFD. if (result == OK || IsCertificateError(result)) status = ssl_socket->GetNextProto(&proto); - static const char kSpdyProto[] = "spdy"; using_spdy_ = (status == SSLClientSocket::kNextProtoNegotiated && - proto == kSpdyProto); + SSLClientSocket::NextProtoFromString(proto) == + SSLClientSocket::kProtoSPDY1); if (alternate_protocol_mode_ == kUsingAlternateProtocol && alternate_protocol_ == HttpAlternateProtocols::NPN_SPDY_1 && |