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

Unified Diff: net/spdy/spdy_protocol.cc

Issue 483843004: HTTP2 draft 13: support unknown frame types and settings types as extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@merge_1
Patch Set: Add mock OnUnknownFrame to SpdyFramerVisitor in spdy_interface_test. Created 6 years, 4 months 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_protocol.h ('k') | net/spdy/spdy_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_protocol.cc
diff --git a/net/spdy/spdy_protocol.cc b/net/spdy/spdy_protocol.cc
index 6b55b11ea945e09e34029e8c4d30dc430041d03a..1ab0d5bdcf40ba7af0e1ac81c54432daedb4e722 100644
--- a/net/spdy/spdy_protocol.cc
+++ b/net/spdy/spdy_protocol.cc
@@ -43,13 +43,19 @@ bool SpdyConstants::IsValidFrameType(SpdyMajorVersion version,
return true;
case SPDY4:
case SPDY5:
+ // Check for recognized extensions.
+ if (frame_type_field == SerializeFrameType(version, ALTSVC) ||
+ frame_type_field == SerializeFrameType(version, BLOCKED)) {
+ return true;
+ }
+
// DATA is the first valid frame.
if (frame_type_field < SerializeFrameType(version, DATA)) {
return false;
}
- // BLOCKED is the last valid frame.
- if (frame_type_field > SerializeFrameType(version, BLOCKED)) {
+ // CONTINUATION is the last valid frame.
+ if (frame_type_field > SerializeFrameType(version, CONTINUATION)) {
return false;
}
@@ -168,6 +174,7 @@ int SpdyConstants::SerializeFrameType(SpdyMajorVersion version,
return 8;
case CONTINUATION:
return 9;
+ // ALTSVC and BLOCKED are extensions.
case ALTSVC:
return 10;
case BLOCKED:
« no previous file with comments | « net/spdy/spdy_protocol.h ('k') | net/spdy/spdy_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698