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

Unified Diff: net/spdy/spdy_framer.cc

Issue 243613003: Refactor GOAWAY status code handling, also handle SPDY4/HTTP2 status codes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor build fixes. 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_protocol.h » ('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 5242e806b36b2d77aaba722e8dfb61c37a362cd1..69d13aabd64950e61a5b2bbcdda6aafe44f55099 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -1754,10 +1754,10 @@ size_t SpdyFramer::ProcessGoAwayFramePayload(const char* data, size_t len) {
uint32 status_raw = GOAWAY_OK;
successful_read = reader.ReadUInt32(&status_raw);
DCHECK(successful_read);
- // We've read an unsigned integer, so it's enough to only check
- // upper bound to ensure the value is in valid range.
- if (status_raw < GOAWAY_NUM_STATUS_CODES) {
- status = static_cast<SpdyGoAwayStatus>(status_raw);
+ if (SpdyConstants::IsValidGoAwayStatus(protocol_version(),
+ status_raw)) {
+ 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
« no previous file with comments | « no previous file | net/spdy/spdy_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698