summaryrefslogtreecommitdiffstats
path: root/net/socket
diff options
context:
space:
mode:
authorrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-27 03:45:20 +0000
committerrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-27 03:45:20 +0000
commitf20365f0541ee445ce776ef96c0e2394d08f21cf (patch)
tree15c941bb3c89eaf20bd4ea3642eeeb21b0b0c3b6 /net/socket
parent629dfb26e24e824b8b02c7fa3f6ccfedd5634672 (diff)
downloadchromium_src-f20365f0541ee445ce776ef96c0e2394d08f21cf.zip
chromium_src-f20365f0541ee445ce776ef96c0e2394d08f21cf.tar.gz
chromium_src-f20365f0541ee445ce776ef96c0e2394d08f21cf.tar.bz2
Add a new SSLClientSocket::wasSpdyNegotiated method,
and modify HttpStreamRequest::DoInitConnectionComplete to call it. BUG=none TEST=none Review URL: http://codereview.chromium.org/3173053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57633 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket')
-rw-r--r--net/socket/ssl_client_socket.h12
-rw-r--r--net/socket/ssl_client_socket_pool.cc5
2 files changed, 13 insertions, 4 deletions
diff --git a/net/socket/ssl_client_socket.h b/net/socket/ssl_client_socket.h
index 7e5e080..9c8e84a 100644
--- a/net/socket/ssl_client_socket.h
+++ b/net/socket/ssl_client_socket.h
@@ -25,7 +25,7 @@ class SSLInfo;
//
class SSLClientSocket : public ClientSocket {
public:
- SSLClientSocket() : was_npn_negotiated_(false) {
+ SSLClientSocket() : was_npn_negotiated_(false), was_spdy_negotiated_(false) {
}
// Next Protocol Negotiation (NPN) allows a TLS client and server to come to
// an agreement about the application level protocol to speak over a
@@ -102,9 +102,19 @@ class SSLClientSocket : public ClientSocket {
return was_npn_negotiated_ = negotiated;
}
+ virtual bool wasSpdyNegotiated() const {
+ return was_spdy_negotiated_;
+ }
+
+ virtual bool setWasSpdyNegotiated(bool negotiated) {
+ return was_spdy_negotiated_ = negotiated;
+ }
+
private:
// True if NPN was responded to, independent of selecting SPDY or HTTP.
bool was_npn_negotiated_;
+ // True if NPN successfully negotiated SPDY.
+ bool was_spdy_negotiated_;
};
} // namespace net
diff --git a/net/socket/ssl_client_socket_pool.cc b/net/socket/ssl_client_socket_pool.cc
index 90da3de..12d273d 100644
--- a/net/socket/ssl_client_socket_pool.cc
+++ b/net/socket/ssl_client_socket_pool.cc
@@ -281,7 +281,6 @@ int SSLConnectJob::DoSSLConnectComplete(int result) {
status = ssl_socket_->GetNextProto(&proto);
// If we want spdy over npn, make sure it succeeded.
- bool spdy_over_npn_succeeded = false;
if (status == SSLClientSocket::kNextProtoNegotiated) {
ssl_socket_->setWasNpnNegotiated(true);
SSLClientSocket::NextProto next_protocol =
@@ -291,10 +290,10 @@ int SSLConnectJob::DoSSLConnectComplete(int result) {
// TODO(mbelshe): verify it was a protocol we advertised?
if (next_protocol == SSLClientSocket::kProtoSPDY1 ||
next_protocol == SSLClientSocket::kProtoSPDY2) {
- spdy_over_npn_succeeded = true;
+ ssl_socket_->setWasSpdyNegotiated(true);
}
}
- if (params_->want_spdy_over_npn() && !spdy_over_npn_succeeded)
+ if (params_->want_spdy_over_npn() && !ssl_socket_->wasSpdyNegotiated())
return ERR_NPN_NEGOTIATION_FAILED;
// Spdy might be turned on by default, or it might be over npn.