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

Unified Diff: net/spdy/spdy_protocol.h

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 | « net/spdy/spdy_framer.cc ('k') | net/spdy/spdy_protocol.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_protocol.h
diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h
index b02339a155688a2fcd3303a6b2366ed00d74a71f..9549db57eb5e4e99dd3cf6ff9a355937b2c62b70 100644
--- a/net/spdy/spdy_protocol.h
+++ b/net/spdy/spdy_protocol.h
@@ -379,11 +379,20 @@ enum SpdyRstStreamStatus {
// Status codes for GOAWAY frames.
enum SpdyGoAwayStatus {
- GOAWAY_INVALID = -1,
GOAWAY_OK = 0,
+ GOAWAY_NO_ERROR = GOAWAY_OK,
GOAWAY_PROTOCOL_ERROR = 1,
GOAWAY_INTERNAL_ERROR = 2,
- GOAWAY_NUM_STATUS_CODES = 3 // Must be last.
+ GOAWAY_FLOW_CONTROL_ERROR = 3,
+ GOAWAY_SETTINGS_TIMEOUT = 4,
+ GOAWAY_STREAM_CLOSED = 5,
+ GOAWAY_FRAME_SIZE_ERROR = 6,
+ GOAWAY_REFUSED_STREAM = 7,
+ GOAWAY_CANCEL = 8,
+ GOAWAY_COMPRESSION_ERROR = 9,
+ GOAWAY_CONNECT_ERROR = 10,
+ GOAWAY_ENHANCE_YOUR_CALM = 11,
+ GOAWAY_INADEQUATE_SECURITY = 12
};
// A SPDY priority is a number between 0 and 7 (inclusive).
@@ -451,6 +460,24 @@ class NET_EXPORT_PRIVATE SpdyConstants {
// version).
static int SerializeRstStreamStatus(SpdyMajorVersion version,
SpdyRstStreamStatus rst_stream_status);
+
+ // Returns true if a given on-the-wire enumeration of a GOAWAY status code is
+ // valid for the given protocol version, false otherwise.
+ static bool IsValidGoAwayStatus(SpdyMajorVersion version,
+ int goaway_status_field);
+
+ // Parses a GOAWAY status from an on-the-wire enumeration of a given protocol
+ // version.
+ // Behavior is undefined for invalid GOAWAY status fields; consumers should
+ // first use IsValidGoAwayStatus() to verify validity of GOAWAY status fields.
+ static SpdyGoAwayStatus ParseGoAwayStatus(SpdyMajorVersion version,
+ int goaway_status_field);
+
+ // Serializes a given GOAWAY status to the on-the-wire enumeration value for
+ // the given protocol version.
+ // Returns -1 on failure (I.E. Invalid GOAWAY status for the given version).
+ static int SerializeGoAwayStatus(SpdyMajorVersion version,
+ SpdyGoAwayStatus status);
};
class SpdyFrame;
« no previous file with comments | « net/spdy/spdy_framer.cc ('k') | net/spdy/spdy_protocol.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698