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

Unified Diff: net/spdy/spdy_test_util_spdy3.cc

Issue 14232014: Correctly handle SPDY GOAWAY frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comments Created 7 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
Index: net/spdy/spdy_test_util_spdy3.cc
diff --git a/net/spdy/spdy_test_util_spdy3.cc b/net/spdy/spdy_test_util_spdy3.cc
index 0005366b67c999e216d4316cc50f551bf24d5405..207cb481f257a7d48d6f1935cf4287822e5c0cce 100644
--- a/net/spdy/spdy_test_util_spdy3.cc
+++ b/net/spdy/spdy_test_util_spdy3.cc
@@ -173,58 +173,43 @@ SpdyFrame* ConstructSpdyFrame(const SpdyHeaderInfo& header_info,
return ConstructSpdyFrame(header_info, headers.Pass());
}
-// Construct an expected SPDY SETTINGS frame.
-// |settings| are the settings to set.
-// Returns the constructed frame. The caller takes ownership of the frame.
SpdyFrame* ConstructSpdySettings(const SettingsMap& settings) {
BufferedSpdyFramer framer(3, false);
return framer.CreateSettings(settings);
}
-// Construct an expected SPDY CREDENTIAL frame.
-// |credential| is the credential to sen.
-// Returns the constructed frame. The caller takes ownership of the frame.
SpdyFrame* ConstructSpdyCredential(
const SpdyCredential& credential) {
BufferedSpdyFramer framer(3, false);
return framer.CreateCredentialFrame(credential);
}
-// Construct a SPDY PING frame.
-// Returns the constructed frame. The caller takes ownership of the frame.
SpdyFrame* ConstructSpdyPing(uint32 ping_id) {
BufferedSpdyFramer framer(3, false);
return framer.CreatePingFrame(ping_id);
}
-// Construct a SPDY GOAWAY frame.
-// Returns the constructed frame. The caller takes ownership of the frame.
SpdyFrame* ConstructSpdyGoAway() {
+ return ConstructSpdyGoAway(0);
+}
+
+SpdyFrame* ConstructSpdyGoAway(SpdyStreamId last_good_stream_id) {
BufferedSpdyFramer framer(3, false);
- return framer.CreateGoAway(0, GOAWAY_OK);
+ return framer.CreateGoAway(last_good_stream_id, GOAWAY_OK);
}
-// Construct a SPDY WINDOW_UPDATE frame.
-// Returns the constructed frame. The caller takes ownership of the frame.
SpdyFrame* ConstructSpdyWindowUpdate(
const SpdyStreamId stream_id, uint32 delta_window_size) {
BufferedSpdyFramer framer(3, false);
return framer.CreateWindowUpdate(stream_id, delta_window_size);
}
-// Construct a SPDY RST_STREAM frame.
-// Returns the constructed frame. The caller takes ownership of the frame.
SpdyFrame* ConstructSpdyRstStream(SpdyStreamId stream_id,
SpdyRstStreamStatus status) {
BufferedSpdyFramer framer(3, false);
return framer.CreateRstStream(stream_id, status);
}
-// Construct a single SPDY header entry, for validation.
-// |extra_headers| are the extra header-value pairs.
-// |buffer| is the buffer we're filling in.
-// |index| is the index of the header we want.
-// Returns the number of bytes written into |buffer|.
int ConstructSpdyHeader(const char* const extra_headers[],
int extra_header_count,
char* buffer,
@@ -342,11 +327,6 @@ SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[],
associated_stream_id);
}
-// Constructs a standard SPDY GET SYN frame, optionally compressed
-// for the url |url|.
-// |extra_headers| are the extra header-value pairs, which typically
-// will vary the most between calls.
-// Returns a SpdyFrame.
SpdyFrame* ConstructSpdyGet(const char* const url,
bool compressed,
SpdyStreamId stream_id,
@@ -368,10 +348,6 @@ SpdyFrame* ConstructSpdyGet(const char* const url,
return ConstructSpdyFrame(kSynStartHeader, ConstructGetHeaderBlock(url));
}
-// Constructs a standard SPDY GET SYN frame, optionally compressed.
-// |extra_headers| are the extra header-value pairs, which typically
-// will vary the most between calls.
-// Returns a SpdyFrame.
SpdyFrame* ConstructSpdyGet(const char* const extra_headers[],
int extra_header_count,
bool compressed,
@@ -381,10 +357,6 @@ SpdyFrame* ConstructSpdyGet(const char* const extra_headers[],
stream_id, request_priority, true);
}
-// Constructs a standard SPDY GET SYN frame, optionally compressed.
-// |extra_headers| are the extra header-value pairs, which typically
-// will vary the most between calls.
-// Returns a SpdyFrame.
SpdyFrame* ConstructSpdyGet(const char* const extra_headers[],
int extra_header_count,
bool compressed,
@@ -409,7 +381,6 @@ SpdyFrame* ConstructSpdyGet(const char* const extra_headers[],
arraysize(kStandardGetHeaders));
}
-// Constructs a standard SPDY SYN_STREAM frame for a CONNECT request.
SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[],
int extra_header_count,
int stream_id) {
@@ -430,10 +401,6 @@ SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[],
arraysize(kConnectHeaders));
}
-// Constructs a standard SPDY push SYN frame.
-// |extra_headers| are the extra header-value pairs, which typically
-// will vary the most between calls.
-// Returns a SpdyFrame.
SpdyFrame* ConstructSpdyPush(const char* const extra_headers[],
int extra_header_count,
int stream_id,
@@ -530,8 +497,6 @@ SpdyFrame* ConstructSpdyPushHeaders(int stream_id,
arraysize(kStandardGetHeaders));
}
-// Constructs a standard SPDY SYN_REPLY frame with the specified status code.
-// Returns a SpdyFrame.
SpdyFrame* ConstructSpdySynReplyError(const char* const status,
const char* const* const extra_headers,
int extra_header_count,
@@ -552,10 +517,6 @@ SpdyFrame* ConstructSpdySynReplyError(const char* const status,
arraysize(kStandardGetHeaders));
}
-// Constructs a standard SPDY SYN_REPLY frame to match the SPDY GET.
-// |extra_headers| are the extra header-value pairs, which typically
-// will vary the most between calls.
-// Returns a SpdyFrame.
SpdyFrame* ConstructSpdyGetSynReplyRedirect(int stream_id) {
static const char* const kExtraHeaders[] = {
"location", "http://www.foo.com/index.php",
@@ -564,20 +525,10 @@ SpdyFrame* ConstructSpdyGetSynReplyRedirect(int stream_id) {
arraysize(kExtraHeaders)/2, stream_id);
}
-// Constructs a standard SPDY SYN_REPLY frame with an Internal Server
-// Error status code.
-// Returns a SpdyFrame.
SpdyFrame* ConstructSpdySynReplyError(int stream_id) {
return ConstructSpdySynReplyError("500 Internal Server Error", NULL, 0, 1);
}
-
-
-
-// Constructs a standard SPDY SYN_REPLY frame to match the SPDY GET.
-// |extra_headers| are the extra header-value pairs, which typically
-// will vary the most between calls.
-// Returns a SpdyFrame.
SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[],
int extra_header_count,
int stream_id) {
@@ -597,11 +548,6 @@ SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[],
arraysize(kStandardGetHeaders));
}
-// Constructs a standard SPDY POST SYN frame.
-// |content_length| is the size of post data.
-// |extra_headers| are the extra header-value pairs, which typically
-// will vary the most between calls.
-// Returns a SpdyFrame.
SpdyFrame* ConstructSpdyPost(const char* url,
SpdyStreamId stream_id,
int64 content_length,
@@ -712,11 +658,6 @@ SpdyFrame* ConstructWrappedSpdyFrame(const scoped_ptr<SpdyFrame>& frame,
false);
}
-// Construct an expected SPDY reply string.
-// |extra_headers| are the extra header-value pairs, which typically
-// will vary the most between calls.
-// |buffer| is the buffer we're filling in.
-// Returns the number of bytes written into |buffer|.
int ConstructSpdyReplyString(const char* const extra_headers[],
int extra_header_count,
char* buffer,

Powered by Google App Engine
This is Rietveld 408576698