summaryrefslogtreecommitdiffstats
path: root/net/socket
diff options
context:
space:
mode:
Diffstat (limited to 'net/socket')
-rw-r--r--net/socket/next_proto.h4
-rw-r--r--net/socket/ssl_client_socket.cc4
-rw-r--r--net/socket/ssl_client_socket_pool.cc11
3 files changed, 13 insertions, 6 deletions
diff --git a/net/socket/next_proto.h b/net/socket/next_proto.h
index a60437f..7ba3e57 100644
--- a/net/socket/next_proto.h
+++ b/net/socket/next_proto.h
@@ -14,11 +14,15 @@ namespace net {
enum NextProto {
kProtoUnknown = 0,
kProtoHTTP11 = 1,
+
kProtoSPDY1 = 2,
+ kProtoSPDYMinimumVersion = kProtoSPDY1,
kProtoSPDY2 = 3,
kProtoSPDY21 = 4,
kProtoSPDY3 = 5,
kProtoSPDY31 = 6,
+ kProtoSPDYMaximumVersion = kProtoSPDY31,
+
kProtoMaximumVersion = 7,
};
diff --git a/net/socket/ssl_client_socket.cc b/net/socket/ssl_client_socket.cc
index 7f23258..478ef18 100644
--- a/net/socket/ssl_client_socket.cc
+++ b/net/socket/ssl_client_socket.cc
@@ -26,6 +26,8 @@ NextProto SSLClientSocket::NextProtoFromString(
return kProtoSPDY2;
} else if (proto_string == "spdy/3") {
return kProtoSPDY3;
+ } else if (proto_string == "spdy/3.1") {
+ return kProtoSPDY31;
} else {
return kProtoUnknown;
}
@@ -42,6 +44,8 @@ const char* SSLClientSocket::NextProtoToString(NextProto next_proto) {
return "spdy/2";
case kProtoSPDY3:
return "spdy/3";
+ case kProtoSPDY31:
+ return "spdy/3.1";
default:
break;
}
diff --git a/net/socket/ssl_client_socket_pool.cc b/net/socket/ssl_client_socket_pool.cc
index 826ccc8..64ebf28 100644
--- a/net/socket/ssl_client_socket_pool.cc
+++ b/net/socket/ssl_client_socket_pool.cc
@@ -301,12 +301,11 @@ int SSLConnectJob::DoSSLConnectComplete(int result) {
NextProto protocol_negotiated =
SSLClientSocket::NextProtoFromString(proto);
ssl_socket_->set_protocol_negotiated(protocol_negotiated);
- // If we negotiated either version of SPDY, we must have
- // advertised it, so allow it.
- // TODO(mbelshe): verify it was a protocol we advertised?
- if (protocol_negotiated == kProtoSPDY1 ||
- protocol_negotiated == kProtoSPDY2 ||
- protocol_negotiated == kProtoSPDY3) {
+ // If we negotiated a SPDY version, it must have been present in
+ // SSLConfig::next_protos.
+ // TODO(mbelshe): Verify this.
+ if (protocol_negotiated >= kProtoSPDYMinimumVersion &&
+ protocol_negotiated <= kProtoSPDYMaximumVersion) {
ssl_socket_->set_was_spdy_negotiated(true);
}
}