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

Unified Diff: net/spdy/spdy_framer.cc

Issue 247503002: SPDY: RST_STREAM and GO_AWAY status checking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | « no previous file | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_framer.cc
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index 5afa3f22a13899cb73d822f6b78e304933355cfd..fe6958dc8d90d3ec92d7c2d2925c7dbd0ba05dc0 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -1755,10 +1755,14 @@ size_t SpdyFramer::ProcessGoAwayFramePayload(const char* data, size_t len) {
status = SpdyConstants::ParseGoAwayStatus(protocol_version(),
status_raw);
} else {
- // TODO(hkhalil): Probably best to OnError here, depending on
- // our interpretation of the spec. Keeping with existing liberal
- // behavior for now.
DCHECK(false);
+ // Throw an error for SPDY4+, keep liberal behavior
+ // for earlier versions.
+ if (protocol_version() > SPDY3) {
+ DLOG(WARNING) << "Invalid GO_AWAY status " << status_raw;
+ set_error(SPDY_INVALID_CONTROL_FRAME);
+ return 0;
+ }
}
}
// Finished parsing the GOAWAY header, call frame handler.
@@ -1820,9 +1824,13 @@ size_t SpdyFramer::ProcessRstStreamFramePayload(const char* data, size_t len) {
status_raw)) {
status = static_cast<SpdyRstStreamStatus>(status_raw);
} else {
- // TODO(hkhalil): Probably best to OnError here, depending on
- // our interpretation of the spec. Keeping with existing liberal
- // behavior for now.
+ // Throw an error for SPDY4+, keep liberal behavior
+ // for earlier versions.
+ if (protocol_version() > SPDY3) {
+ DLOG(WARNING) << "Invalid RST_STREAM status " << status_raw;
+ set_error(SPDY_INVALID_CONTROL_FRAME);
+ return 0;
+ }
}
// Finished parsing the RST_STREAM header, call frame handler.
visitor_->OnRstStream(current_frame_stream_id_, status);
« no previous file with comments | « no previous file | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698