Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(641)

Unified Diff: net/spdy/spdy_session.cc

Issue 724523002: Support HTTP/2 drafts 14 and 15 simultaneously. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename CONNECTION_INFO_SPDY4 to CONNECTION_INFO_HTTP2. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_proxy_client_socket_unittest.cc ('k') | net/spdy/spdy_session_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session.cc
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 5430e27ff47869d8190c080c3b19f2aeaa07d1c5..90bc6d00392f5f231d34245ee72da57a72343951 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -721,7 +721,8 @@ void SpdySession::InitializeWithSocket(
DCHECK_GE(protocol_, kProtoSPDYMinimumVersion);
DCHECK_LE(protocol_, kProtoSPDYMaximumVersion);
- if (protocol_ == kProtoSPDY4)
+ if ((protocol_ >= kProtoSPDY4MinimumVersion) &&
+ (protocol_ <= kProtoSPDY4MaximumVersion))
send_connection_header_prefix_ = true;
if (protocol_ >= kProtoSPDY31) {
@@ -2457,8 +2458,8 @@ void SpdySession::OnPing(SpdyPingId unique_id, bool is_ack) {
base::Bind(&NetLogSpdyPingCallback, unique_id, is_ack, "received"));
// Send response to a PING from server.
- if ((protocol_ >= kProtoSPDY4 && !is_ack) ||
- (protocol_ < kProtoSPDY4 && unique_id % 2 == 0)) {
+ if ((protocol_ >= kProtoSPDY4MinimumVersion && !is_ack) ||
+ (protocol_ < kProtoSPDY4MinimumVersion && unique_id % 2 == 0)) {
WritePingFrame(unique_id, true);
return;
}
@@ -2744,7 +2745,8 @@ void SpdySession::SendInitialData() {
DCHECK(enable_sending_initial_data_);
if (send_connection_header_prefix_) {
- DCHECK_EQ(protocol_, kProtoSPDY4);
+ DCHECK_GE(protocol_, kProtoSPDY4MinimumVersion);
+ DCHECK_LE(protocol_, kProtoSPDY4MaximumVersion);
scoped_ptr<SpdyFrame> connection_header_prefix_frame(
new SpdyFrame(const_cast<char*>(kHttp2ConnectionHeaderPrefix),
kHttp2ConnectionHeaderPrefixSize,
« no previous file with comments | « net/spdy/spdy_proxy_client_socket_unittest.cc ('k') | net/spdy/spdy_session_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698