diff options
31 files changed, 208 insertions, 204 deletions
diff --git a/net/http/http_network_transaction_spdy2_unittest.cc b/net/http/http_network_transaction_spdy2_unittest.cc index 02aa3d3..973876c 100644 --- a/net/http/http_network_transaction_spdy2_unittest.cc +++ b/net/http/http_network_transaction_spdy2_unittest.cc @@ -2906,7 +2906,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyConnectFailure) { // CONNECT to www.google.com:443 via SPDY scoped_ptr<SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> get(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> get(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*connect, 1), @@ -5596,7 +5596,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RedirectOfHttpsConnectViaSpdyProxy) { request.load_flags = 0; scoped_ptr<SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> goaway(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> goaway(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite data_writes[] = { CreateMockWrite(*conn.get(), 0, SYNCHRONOUS), }; @@ -5700,7 +5700,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, request.load_flags = 0; scoped_ptr<SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite data_writes[] = { CreateMockWrite(*conn.get(), 0, SYNCHRONOUS), CreateMockWrite(*rst.get(), 3, SYNCHRONOUS), @@ -5763,7 +5763,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthSpdyProxy) { // Since we have proxy, should try to establish tunnel. scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); // After calling trans->RestartWithAuth(), this is the request we should // be issuing -- the final header line contains the credentials. @@ -6031,7 +6031,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, CrossOriginProxyPushCorrectness) { stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false)); scoped_ptr<SpdyFrame> push_rst( - ConstructSpdyRstStream(2, REFUSED_STREAM)); + ConstructSpdyRstStream(2, RST_STREAM_REFUSED_STREAM)); MockWrite spdy_writes[] = { CreateMockWrite(*stream1_syn, 1, ASYNC), diff --git a/net/http/http_network_transaction_spdy3_unittest.cc b/net/http/http_network_transaction_spdy3_unittest.cc index e576181..7b06f5c 100644 --- a/net/http/http_network_transaction_spdy3_unittest.cc +++ b/net/http/http_network_transaction_spdy3_unittest.cc @@ -2906,7 +2906,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyConnectFailure) { // CONNECT to www.google.com:443 via SPDY scoped_ptr<SpdyFrame> connect(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> get(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> get(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*connect, 1), @@ -5577,7 +5577,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RedirectOfHttpsConnectViaSpdyProxy) { request.load_flags = 0; scoped_ptr<SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> goaway(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> goaway(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite data_writes[] = { CreateMockWrite(*conn.get(), 0, SYNCHRONOUS), }; @@ -5681,7 +5681,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, request.load_flags = 0; scoped_ptr<SpdyFrame> conn(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite data_writes[] = { CreateMockWrite(*conn.get(), 0, SYNCHRONOUS), CreateMockWrite(*rst.get(), 3, SYNCHRONOUS), @@ -5744,7 +5744,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthSpdyProxy) { // Since we have proxy, should try to establish tunnel. scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); // After calling trans->RestartWithAuth(), this is the request we should // be issuing -- the final header line contains the credentials. @@ -6012,7 +6012,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, CrossOriginProxyPushCorrectness) { stream1_syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false)); scoped_ptr<SpdyFrame> push_rst( - ConstructSpdyRstStream(2, REFUSED_STREAM)); + ConstructSpdyRstStream(2, RST_STREAM_REFUSED_STREAM)); MockWrite spdy_writes[] = { CreateMockWrite(*stream1_syn, 1, ASYNC), diff --git a/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc b/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc index 4938628..53fa1f7 100644 --- a/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc @@ -233,7 +233,7 @@ TEST_P(HttpProxyClientSocketPoolSpdy2Test, NeedAuth) { MockRead(ASYNC, 4, "0123456789"), }; scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), CreateMockWrite(*rst, 2, ASYNC), @@ -479,7 +479,7 @@ TEST_P(HttpProxyClientSocketPoolSpdy2Test, TunnelSetupError) { }; scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), CreateMockWrite(*rst, 2, ASYNC), @@ -529,7 +529,7 @@ TEST_P(HttpProxyClientSocketPoolSpdy2Test, TunnelSetupRedirect) { }; scoped_ptr<SpdyFrame> req( ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), diff --git a/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc b/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc index 64cfd8e..b7f64b3 100644 --- a/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc @@ -233,7 +233,7 @@ TEST_P(HttpProxyClientSocketPoolSpdy3Test, NeedAuth) { MockRead(ASYNC, 4, "0123456789"), }; scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(NULL, 0, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), CreateMockWrite(*rst, 2, ASYNC), @@ -480,7 +480,7 @@ TEST_P(HttpProxyClientSocketPoolSpdy3Test, TunnelSetupError) { }; scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), CreateMockWrite(*rst, 2, ASYNC), @@ -530,7 +530,7 @@ TEST_P(HttpProxyClientSocketPoolSpdy3Test, TunnelSetupRedirect) { }; scoped_ptr<SpdyFrame> req( ConstructSpdyConnect(kAuthHeaders, kAuthHeadersSize, 1)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite spdy_writes[] = { CreateMockWrite(*req, 0, ASYNC), diff --git a/net/spdy/buffered_spdy_framer.cc b/net/spdy/buffered_spdy_framer.cc index a24cf25..7f21b9a 100644 --- a/net/spdy/buffered_spdy_framer.cc +++ b/net/spdy/buffered_spdy_framer.cc @@ -167,7 +167,7 @@ void BufferedSpdyFramer::OnPing(uint32 unique_id) { } void BufferedSpdyFramer::OnRstStream(SpdyStreamId stream_id, - SpdyStatusCodes status) { + SpdyRstStreamStatus status) { visitor_->OnRstStream(stream_id, status); } void BufferedSpdyFramer::OnGoAway(SpdyStreamId last_accepted_stream_id, @@ -239,7 +239,7 @@ SpdySynReplyControlFrame* BufferedSpdyFramer::CreateSynReply( SpdyRstStreamControlFrame* BufferedSpdyFramer::CreateRstStream( SpdyStreamId stream_id, - SpdyStatusCodes status) const { + SpdyRstStreamStatus status) const { return spdy_framer_.CreateRstStream(stream_id, status); } diff --git a/net/spdy/buffered_spdy_framer.h b/net/spdy/buffered_spdy_framer.h index ea64151..588a07f 100644 --- a/net/spdy/buffered_spdy_framer.h +++ b/net/spdy/buffered_spdy_framer.h @@ -66,7 +66,8 @@ class NET_EXPORT_PRIVATE BufferedSpdyFramerVisitorInterface { virtual void OnPing(uint32 unique_id) = 0; // Called when a RST_STREAM frame has been parsed. - virtual void OnRstStream(SpdyStreamId stream_id, SpdyStatusCodes status) = 0; + virtual void OnRstStream(SpdyStreamId stream_id, + SpdyRstStreamStatus status) = 0; // Called when a GOAWAY frame has been parsed. virtual void OnGoAway(SpdyStreamId last_accepted_stream_id, @@ -125,7 +126,7 @@ class NET_EXPORT_PRIVATE BufferedSpdyFramer SpdySettingsIds id, uint8 flags, uint32 value) OVERRIDE; virtual void OnPing(uint32 unique_id) OVERRIDE; virtual void OnRstStream(SpdyStreamId stream_id, - SpdyStatusCodes status) OVERRIDE; + SpdyRstStreamStatus status) OVERRIDE; virtual void OnGoAway(SpdyStreamId last_accepted_stream_id, SpdyGoAwayStatus status) OVERRIDE; virtual void OnWindowUpdate(SpdyStreamId stream_id, @@ -158,7 +159,7 @@ class NET_EXPORT_PRIVATE BufferedSpdyFramer bool compressed, const SpdyHeaderBlock* headers); SpdyRstStreamControlFrame* CreateRstStream(SpdyStreamId stream_id, - SpdyStatusCodes status) const; + SpdyRstStreamStatus status) const; SpdySettingsControlFrame* CreateSettings(const SettingsMap& values) const; SpdyPingControlFrame* CreatePingFrame(uint32 unique_id) const; SpdyGoAwayControlFrame* CreateGoAway( diff --git a/net/spdy/buffered_spdy_framer_spdy2_unittest.cc b/net/spdy/buffered_spdy_framer_spdy2_unittest.cc index a3ea858..5a1f72f 100644 --- a/net/spdy/buffered_spdy_framer_spdy2_unittest.cc +++ b/net/spdy/buffered_spdy_framer_spdy2_unittest.cc @@ -85,7 +85,7 @@ class TestBufferedSpdyVisitor : public BufferedSpdyFramerVisitorInterface { virtual void OnPing(uint32 unique_id) OVERRIDE {} virtual void OnRstStream(SpdyStreamId stream_id, - SpdyStatusCodes status) OVERRIDE { + SpdyRstStreamStatus status) OVERRIDE { } virtual void OnGoAway(SpdyStreamId last_accepted_stream_id, diff --git a/net/spdy/buffered_spdy_framer_spdy3_unittest.cc b/net/spdy/buffered_spdy_framer_spdy3_unittest.cc index 777b49c..c6dc5a2 100644 --- a/net/spdy/buffered_spdy_framer_spdy3_unittest.cc +++ b/net/spdy/buffered_spdy_framer_spdy3_unittest.cc @@ -84,7 +84,7 @@ class TestBufferedSpdyVisitor : public BufferedSpdyFramerVisitorInterface { virtual void OnPing(uint32 unique_id) OVERRIDE {} virtual void OnRstStream(SpdyStreamId stream_id, - SpdyStatusCodes status) OVERRIDE {} + SpdyRstStreamStatus status) OVERRIDE {} virtual void OnGoAway(SpdyStreamId last_accepted_stream_id, SpdyGoAwayStatus status) OVERRIDE { diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc index abc55f3..0b95e63 100644 --- a/net/spdy/spdy_framer.cc +++ b/net/spdy/spdy_framer.cc @@ -213,29 +213,29 @@ const char* SpdyFramer::ErrorCodeToString(int error_code) { const char* SpdyFramer::StatusCodeToString(int status_code) { switch (status_code) { - case INVALID: + case RST_STREAM_INVALID: return "INVALID"; - case PROTOCOL_ERROR: + case RST_STREAM_PROTOCOL_ERROR: return "PROTOCOL_ERROR"; - case INVALID_STREAM: + case RST_STREAM_INVALID_STREAM: return "INVALID_STREAM"; - case REFUSED_STREAM: + case RST_STREAM_REFUSED_STREAM: return "REFUSED_STREAM"; - case UNSUPPORTED_VERSION: + case RST_STREAM_UNSUPPORTED_VERSION: return "UNSUPPORTED_VERSION"; - case CANCEL: + case RST_STREAM_CANCEL: return "CANCEL"; - case INTERNAL_ERROR: + case RST_STREAM_INTERNAL_ERROR: return "INTERNAL_ERROR"; - case FLOW_CONTROL_ERROR: + case RST_STREAM_FLOW_CONTROL_ERROR: return "FLOW_CONTROL_ERROR"; - case STREAM_IN_USE: + case RST_STREAM_STREAM_IN_USE: return "STREAM_IN_USE"; - case STREAM_ALREADY_CLOSED: + case RST_STREAM_STREAM_ALREADY_CLOSED: return "STREAM_ALREADY_CLOSED"; - case INVALID_CREDENTIALS: + case RST_STREAM_INVALID_CREDENTIALS: return "INVALID_CREDENTIALS"; - case FRAME_TOO_LARGE: + case RST_STREAM_FRAME_TOO_LARGE: return "FRAME_TOO_LARGE"; } return "UNKNOWN_STATUS"; @@ -395,17 +395,13 @@ size_t SpdyFramer::ProcessCommonHeader(const char* data, size_t len) { remaining_data_ = current_frame.length(); // This is just a sanity check for help debugging early frame errors. - if (remaining_data_ > 1000000u) { // The strncmp for 5 is safe because we only hit this point if we // have SpdyFrame::kHeaderSize (8) bytes - if (!syn_frame_processed_ && + if (remaining_data_ > 1000000u && + !syn_frame_processed_ && strncmp(current_frame_buffer_.get(), "HTTP/", 5) == 0) { LOG(WARNING) << "Unexpected HTTP response to spdy request"; probable_http_response_ = true; - } else { - LOG(WARNING) << "Unexpectedly large frame. " << display_protocol_ - << " session is likely corrupt."; - } } // if we're here, then we have the common header all received. @@ -1326,11 +1322,11 @@ SpdySynReplyControlFrame* SpdyFramer::CreateSynReply( SpdyRstStreamControlFrame* SpdyFramer::CreateRstStream( SpdyStreamId stream_id, - SpdyStatusCodes status) const { + SpdyRstStreamStatus status) const { DCHECK_GT(stream_id, 0u); DCHECK_EQ(0u, stream_id & ~kStreamIdMask); - DCHECK_NE(status, INVALID); - DCHECK_LT(status, NUM_STATUS_CODES); + DCHECK_NE(status, RST_STREAM_INVALID); + DCHECK_LT(status, RST_STREAM_NUM_STATUS_CODES); size_t frame_size = SpdyRstStreamControlFrame::size(); SpdyFrameBuilder frame(RST_STREAM, CONTROL_FLAG_NONE, spdy_version_, diff --git a/net/spdy/spdy_framer.h b/net/spdy/spdy_framer.h index 95f4983..bca151e 100644 --- a/net/spdy/spdy_framer.h +++ b/net/spdy/spdy_framer.h @@ -197,7 +197,8 @@ class NET_EXPORT_PRIVATE SpdyFramerVisitorInterface { virtual void OnPing(uint32 unique_id) = 0; // Called when a RST_STREAM frame has been parsed. - virtual void OnRstStream(SpdyStreamId stream_id, SpdyStatusCodes status) = 0; + virtual void OnRstStream(SpdyStreamId stream_id, + SpdyRstStreamStatus status) = 0; // Called when a GOAWAY frame has been parsed. virtual void OnGoAway(SpdyStreamId last_accepted_stream_id, @@ -369,7 +370,7 @@ class NET_EXPORT_PRIVATE SpdyFramer { const SpdyHeaderBlock* headers); SpdyRstStreamControlFrame* CreateRstStream(SpdyStreamId stream_id, - SpdyStatusCodes status) const; + SpdyRstStreamStatus status) const; // Creates an instance of SpdySettingsControlFrame. The SETTINGS frame is // used to communicate name/value pairs relevant to the communication channel. diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc index ea0fd67..680c59f 100644 --- a/net/spdy/spdy_framer_test.cc +++ b/net/spdy/spdy_framer_test.cc @@ -50,7 +50,7 @@ class MockVisitor : public SpdyFramerVisitorInterface { MOCK_METHOD3(OnSetting, void(SpdySettingsIds id, uint8 flags, uint32 value)); MOCK_METHOD1(OnPing, void(uint32 unique_id)); MOCK_METHOD2(OnRstStream, void(SpdyStreamId stream_id, - SpdyStatusCodes status)); + SpdyRstStreamStatus status)); MOCK_METHOD2(OnGoAway, void(SpdyStreamId last_accepted_stream_id, SpdyGoAwayStatus status)); MOCK_METHOD2(OnWindowUpdate, void(SpdyStreamId stream_id, @@ -204,7 +204,7 @@ class SpdyFramerTestUtil { LOG(FATAL); } virtual void OnRstStream(SpdyStreamId stream_id, - SpdyStatusCodes status) OVERRIDE { + SpdyRstStreamStatus status) OVERRIDE { LOG(FATAL); } virtual void OnGoAway(SpdyStreamId last_accepted_stream_id, @@ -417,7 +417,7 @@ class TestSpdyVisitor : public SpdyFramerVisitorInterface, } virtual void OnRstStream(SpdyStreamId stream_id, - SpdyStatusCodes status) OVERRIDE { + SpdyRstStreamStatus status) OVERRIDE { fin_frame_count_++; } @@ -2010,7 +2010,7 @@ TEST_P(SpdyFramerTest, CreateRstStream) { 0x00, 0x00, 0x00, 0x01, }; scoped_ptr<SpdyRstStreamControlFrame> frame( - framer.CreateRstStream(1, PROTOCOL_ERROR)); + framer.CreateRstStream(1, RST_STREAM_PROTOCOL_ERROR)); CompareFrame(kDescription, *frame, kFrameData, arraysize(kFrameData)); EXPECT_EQ(1u, SpdyFramer::GetControlFrameStreamId(frame.get())); } @@ -2023,8 +2023,8 @@ TEST_P(SpdyFramerTest, CreateRstStream) { 0x7f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01, }; - scoped_ptr<SpdyFrame> frame(framer.CreateRstStream(0x7FFFFFFF, - PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> frame(framer.CreateRstStream( + 0x7FFFFFFF, RST_STREAM_PROTOCOL_ERROR)); CompareFrame(kDescription, *frame, kFrameData, arraysize(kFrameData)); } @@ -2036,8 +2036,8 @@ TEST_P(SpdyFramerTest, CreateRstStream) { 0x7f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x06, }; - scoped_ptr<SpdyFrame> frame(framer.CreateRstStream(0x7FFFFFFF, - INTERNAL_ERROR)); + scoped_ptr<SpdyFrame> frame(framer.CreateRstStream( + 0x7FFFFFFF, RST_STREAM_INTERNAL_ERROR)); CompareFrame(kDescription, *frame, kFrameData, arraysize(kFrameData)); } } @@ -3093,23 +3093,23 @@ TEST_P(SpdyFramerTest, ErrorCodeToStringTest) { TEST_P(SpdyFramerTest, StatusCodeToStringTest) { EXPECT_STREQ("INVALID", - SpdyFramer::StatusCodeToString(INVALID)); + SpdyFramer::StatusCodeToString(RST_STREAM_INVALID)); EXPECT_STREQ("PROTOCOL_ERROR", - SpdyFramer::StatusCodeToString(PROTOCOL_ERROR)); + SpdyFramer::StatusCodeToString(RST_STREAM_PROTOCOL_ERROR)); EXPECT_STREQ("INVALID_STREAM", - SpdyFramer::StatusCodeToString(INVALID_STREAM)); + SpdyFramer::StatusCodeToString(RST_STREAM_INVALID_STREAM)); EXPECT_STREQ("REFUSED_STREAM", - SpdyFramer::StatusCodeToString(REFUSED_STREAM)); + SpdyFramer::StatusCodeToString(RST_STREAM_REFUSED_STREAM)); EXPECT_STREQ("UNSUPPORTED_VERSION", - SpdyFramer::StatusCodeToString(UNSUPPORTED_VERSION)); + SpdyFramer::StatusCodeToString(RST_STREAM_UNSUPPORTED_VERSION)); EXPECT_STREQ("CANCEL", - SpdyFramer::StatusCodeToString(CANCEL)); + SpdyFramer::StatusCodeToString(RST_STREAM_CANCEL)); EXPECT_STREQ("INTERNAL_ERROR", - SpdyFramer::StatusCodeToString(INTERNAL_ERROR)); + SpdyFramer::StatusCodeToString(RST_STREAM_INTERNAL_ERROR)); EXPECT_STREQ("FLOW_CONTROL_ERROR", - SpdyFramer::StatusCodeToString(FLOW_CONTROL_ERROR)); + SpdyFramer::StatusCodeToString(RST_STREAM_FLOW_CONTROL_ERROR)); EXPECT_STREQ("UNKNOWN_STATUS", - SpdyFramer::StatusCodeToString(NUM_STATUS_CODES)); + SpdyFramer::StatusCodeToString(RST_STREAM_NUM_STATUS_CODES)); } TEST_P(SpdyFramerTest, ControlTypeToStringTest) { diff --git a/net/spdy/spdy_http_stream_spdy3_unittest.cc b/net/spdy/spdy_http_stream_spdy3_unittest.cc index 4c31247..3e993ef 100644 --- a/net/spdy/spdy_http_stream_spdy3_unittest.cc +++ b/net/spdy/spdy_http_stream_spdy3_unittest.cc @@ -692,7 +692,7 @@ SpdyFrame* ConstructCredentialRequestFrame(size_t slot, const GURL& url, slot, CONTROL_FLAG_FIN, false, - INVALID, + RST_STREAM_INVALID, NULL, 0, DATA_FLAG_NONE diff --git a/net/spdy/spdy_network_transaction_spdy2_unittest.cc b/net/spdy/spdy_network_transaction_spdy2_unittest.cc index b6568e2..26e5a23 100644 --- a/net/spdy/spdy_network_transaction_spdy2_unittest.cc +++ b/net/spdy/spdy_network_transaction_spdy2_unittest.cc @@ -1481,7 +1481,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, Put) { ConvertRequestPriorityToSpdyPriority(LOWEST, 2), // Priority CONTROL_FLAG_FIN, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags @@ -1508,7 +1508,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, Put) { ConvertRequestPriorityToSpdyPriority(LOWEST, 2), // Priority CONTROL_FLAG_NONE, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags @@ -1551,7 +1551,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, Head) { ConvertRequestPriorityToSpdyPriority(LOWEST, 2), // Priority CONTROL_FLAG_FIN, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags @@ -1578,7 +1578,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, Head) { ConvertRequestPriorityToSpdyPriority(LOWEST, 2), // Priority CONTROL_FLAG_NONE, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags @@ -1850,7 +1850,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, PostWithEarlySynReply) { TEST_P(SpdyNetworkTransactionSpdy2Test, SocketWriteReturnsZero) { scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); scoped_ptr<SpdyFrame> rst( - ConstructSpdyRstStream(1, CANCEL)); + ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite writes[] = { CreateMockWrite(*req.get(), 0, SYNCHRONOUS), MockWrite(SYNCHRONOUS, 0, 0, 2), @@ -1947,7 +1947,8 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ResponseWithTwoSynReplies) { TEST_P(SpdyNetworkTransactionSpdy2Test, ResetReplyWithTransferEncoding) { // Construct the request. scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*rst), @@ -1979,7 +1980,8 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ResetReplyWithTransferEncoding) { TEST_P(SpdyNetworkTransactionSpdy2Test, ResetPushWithTransferEncoding) { // Construct the request. scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(2, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*rst), @@ -2054,7 +2056,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, CancelledTransaction) { TEST_P(SpdyNetworkTransactionSpdy2Test, CancelledTransactionSendRst) { scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); scoped_ptr<SpdyFrame> rst( - ConstructSpdyRstStream(1, CANCEL)); + ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite writes[] = { CreateMockWrite(*req, 0, SYNCHRONOUS), CreateMockWrite(*rst, 2, SYNCHRONOUS), @@ -2308,7 +2310,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, UpperCaseHeaders) { scoped_ptr<SpdyFrame> syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); scoped_ptr<SpdyFrame> - rst(ConstructSpdyRstStream(1, PROTOCOL_ERROR)); + rst(ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*syn, 0), CreateMockWrite(*rst, 2), @@ -2339,7 +2341,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, UpperCaseHeadersInHeadersFrame) { scoped_ptr<SpdyFrame> syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); scoped_ptr<SpdyFrame> - rst(ConstructSpdyRstStream(1, PROTOCOL_ERROR)); + rst(ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*syn, 0), CreateMockWrite(*rst, 2), @@ -2396,7 +2398,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, UpperCaseHeadersOnPush) { scoped_ptr<SpdyFrame> syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); scoped_ptr<SpdyFrame> - rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); + rst(ConstructSpdyRstStream(2, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*syn, 0), CreateMockWrite(*rst, 2), @@ -2467,7 +2469,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, RedirectServerPush) { "301 Moved Permanently", "http://www.foo.com/index.php")); scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(2, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(2, RST_STREAM_CANCEL)); MockWrite writes[] = { CreateMockWrite(*req, 1), CreateMockWrite(*rst, 6), @@ -2729,7 +2731,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushServerAborted) { 1, "http://www.google.com/foo.dat")); scoped_ptr<SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); + stream2_rst(ConstructSpdyRstStream(2, RST_STREAM_PROTOCOL_ERROR)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), CreateMockRead(*stream2_syn, 3), @@ -2786,7 +2788,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushDuplicate) { scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); scoped_ptr<SpdyFrame> - stream3_rst(ConstructSpdyRstStream(4, PROTOCOL_ERROR)); + stream3_rst(ConstructSpdyRstStream(4, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream3_rst, 5), @@ -2963,7 +2965,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushInvalidAssociatedStreamID0) { scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); scoped_ptr<SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, REFUSED_STREAM)); + stream2_rst(ConstructSpdyRstStream(2, RST_STREAM_REFUSED_STREAM)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream2_rst, 4), @@ -3024,7 +3026,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushInvalidAssociatedStreamID9) { scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); scoped_ptr<SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, INVALID_STREAM)); + stream2_rst(ConstructSpdyRstStream(2, RST_STREAM_INVALID_STREAM)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream2_rst, 4), @@ -3085,7 +3087,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushNoURL) { scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); scoped_ptr<SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); + stream2_rst(ConstructSpdyRstStream(2, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream2_rst, 4), @@ -3225,7 +3227,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SynReplyHeadersVary) { ConvertRequestPriorityToSpdyPriority(LOWEST, 2), // Priority CONTROL_FLAG_NONE, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Data Length DATA_FLAG_NONE // Data Flags @@ -3392,7 +3394,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, InvalidSynReply) { ConvertRequestPriorityToSpdyPriority(LOWEST, 2), // Priority CONTROL_FLAG_NONE, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags @@ -3541,7 +3543,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, DecompressFailureOnSynReply) { scoped_ptr<SpdyFrame> compressed( ConstructSpdyGet(NULL, 0, true, 1, LOWEST)); scoped_ptr<SpdyFrame> rst( - ConstructSpdyRstStream(1, PROTOCOL_ERROR)); + ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*compressed), }; @@ -4099,7 +4101,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SettingsSaved) { ConvertRequestPriorityToSpdyPriority(LOWEST, 2), // Priority CONTROL_FLAG_NONE, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Data Length DATA_FLAG_NONE // Data Flags @@ -4205,7 +4207,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, SettingsPlayback) { ConvertRequestPriorityToSpdyPriority(LOWEST, 2), // Priority CONTROL_FLAG_NONE, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Data Length DATA_FLAG_NONE // Data Flags @@ -5564,7 +5566,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushCrossOriginCorrectness) { scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); scoped_ptr<SpdyFrame> push_rst( - ConstructSpdyRstStream(2, REFUSED_STREAM)); + ConstructSpdyRstStream(2, RST_STREAM_REFUSED_STREAM)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*push_rst, 4), @@ -5579,7 +5581,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, ServerPushCrossOriginCorrectness) { 1, url_to_push)); scoped_ptr<SpdyFrame> rst( - ConstructSpdyRstStream(2, CANCEL)); + ConstructSpdyRstStream(2, RST_STREAM_CANCEL)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), @@ -5649,7 +5651,7 @@ TEST_P(SpdyNetworkTransactionSpdy2Test, RetryAfterRefused) { }; scoped_ptr<SpdyFrame> refused( - ConstructSpdyRstStream(1, REFUSED_STREAM)); + ConstructSpdyRstStream(1, RST_STREAM_REFUSED_STREAM)); scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 3)); scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(3, true)); MockRead reads[] = { diff --git a/net/spdy/spdy_network_transaction_spdy3_unittest.cc b/net/spdy/spdy_network_transaction_spdy3_unittest.cc index 7761e6f..0be29ce 100644 --- a/net/spdy/spdy_network_transaction_spdy3_unittest.cc +++ b/net/spdy/spdy_network_transaction_spdy3_unittest.cc @@ -1485,7 +1485,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Put) { 0, // Credential Slot CONTROL_FLAG_FIN, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags @@ -1513,7 +1513,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Put) { 0, // Credential Slot CONTROL_FLAG_NONE, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags @@ -1557,7 +1557,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Head) { 0, // Credential Slot CONTROL_FLAG_FIN, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags @@ -1585,7 +1585,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, Head) { 0, // Credential Slot CONTROL_FLAG_NONE, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags @@ -1859,7 +1859,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, PostWithEarlySynReply) { TEST_P(SpdyNetworkTransactionSpdy3Test, SocketWriteReturnsZero) { scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); scoped_ptr<SpdyFrame> rst( - ConstructSpdyRstStream(1, CANCEL)); + ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite writes[] = { CreateMockWrite(*req.get(), 0, SYNCHRONOUS), MockWrite(SYNCHRONOUS, 0, 0, 2), @@ -2146,7 +2146,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, WindowUpdateOverflow) { scoped_ptr<SpdyFrame> body( ConstructSpdyBodyFrame(1, content->c_str(), content->size(), false)); scoped_ptr<SpdyFrame> rst( - ConstructSpdyRstStream(1, FLOW_CONTROL_ERROR)); + ConstructSpdyRstStream(1, RST_STREAM_FLOW_CONTROL_ERROR)); // We're not going to write a data frame with FIN, we'll receive a bad // WINDOW_UPDATE while sending a request and will send a RST_STREAM frame. @@ -2516,7 +2516,8 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, FlowControlNegativeSendWindowSize) { TEST_P(SpdyNetworkTransactionSpdy3Test, ResetReplyWithTransferEncoding) { // Construct the request. scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*rst), @@ -2548,7 +2549,8 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ResetReplyWithTransferEncoding) { TEST_P(SpdyNetworkTransactionSpdy3Test, ResetPushWithTransferEncoding) { // Construct the request. scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); + scoped_ptr<SpdyFrame> rst( + ConstructSpdyRstStream(2, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*req), CreateMockWrite(*rst), @@ -2625,7 +2627,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, CancelledTransaction) { TEST_P(SpdyNetworkTransactionSpdy3Test, CancelledTransactionSendRst) { scoped_ptr<SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); scoped_ptr<SpdyFrame> rst( - ConstructSpdyRstStream(1, CANCEL)); + ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockWrite writes[] = { CreateMockWrite(*req, 0, SYNCHRONOUS), CreateMockWrite(*rst, 2, SYNCHRONOUS), @@ -2878,7 +2880,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, UpperCaseHeaders) { scoped_ptr<SpdyFrame> syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); scoped_ptr<SpdyFrame> - rst(ConstructSpdyRstStream(1, PROTOCOL_ERROR)); + rst(ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*syn, 0), CreateMockWrite(*rst, 2), @@ -2909,7 +2911,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, UpperCaseHeadersInHeadersFrame) { scoped_ptr<SpdyFrame> syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); scoped_ptr<SpdyFrame> - rst(ConstructSpdyRstStream(1, PROTOCOL_ERROR)); + rst(ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*syn, 0), CreateMockWrite(*rst, 2), @@ -2966,7 +2968,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, UpperCaseHeadersOnPush) { scoped_ptr<SpdyFrame> syn(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); scoped_ptr<SpdyFrame> - rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); + rst(ConstructSpdyRstStream(2, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*syn, 0), CreateMockWrite(*rst, 2), @@ -3040,7 +3042,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, RedirectServerPush) { "301 Moved Permanently", "http://www.foo.com/index.php")); scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(1, true)); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(2, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(2, RST_STREAM_CANCEL)); MockWrite writes[] = { CreateMockWrite(*req, 1), CreateMockWrite(*rst, 6), @@ -3302,7 +3304,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushServerAborted) { 1, "http://www.google.com/foo.dat")); scoped_ptr<SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); + stream2_rst(ConstructSpdyRstStream(2, RST_STREAM_PROTOCOL_ERROR)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), CreateMockRead(*stream2_syn, 3), @@ -3359,7 +3361,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushDuplicate) { scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); scoped_ptr<SpdyFrame> - stream3_rst(ConstructSpdyRstStream(4, PROTOCOL_ERROR)); + stream3_rst(ConstructSpdyRstStream(4, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream3_rst, 5), @@ -3536,7 +3538,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushInvalidAssociatedStreamID0) { scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); scoped_ptr<SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, REFUSED_STREAM)); + stream2_rst(ConstructSpdyRstStream(2, RST_STREAM_REFUSED_STREAM)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream2_rst, 4), @@ -3597,7 +3599,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushInvalidAssociatedStreamID9) { scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); scoped_ptr<SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, INVALID_STREAM)); + stream2_rst(ConstructSpdyRstStream(2, RST_STREAM_INVALID_STREAM)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream2_rst, 4), @@ -3658,7 +3660,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushNoURL) { scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); scoped_ptr<SpdyFrame> - stream2_rst(ConstructSpdyRstStream(2, PROTOCOL_ERROR)); + stream2_rst(ConstructSpdyRstStream(2, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*stream2_rst, 4), @@ -3799,7 +3801,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SynReplyHeadersVary) { 0, // Credential Slot CONTROL_FLAG_NONE, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Data Length DATA_FLAG_NONE // Data Flags @@ -3967,7 +3969,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, InvalidSynReply) { 0, // Credential Slot CONTROL_FLAG_NONE, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags @@ -4116,7 +4118,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, DecompressFailureOnSynReply) { scoped_ptr<SpdyFrame> compressed( ConstructSpdyGet(NULL, 0, true, 1, LOWEST)); scoped_ptr<SpdyFrame> rst( - ConstructSpdyRstStream(1, PROTOCOL_ERROR)); + ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR)); MockWrite writes[] = { CreateMockWrite(*compressed), }; @@ -4675,7 +4677,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SettingsSaved) { 0, // Credential Slot CONTROL_FLAG_NONE, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Data Length DATA_FLAG_NONE // Data Flags @@ -4782,7 +4784,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, SettingsPlayback) { 0, // Credential Slot CONTROL_FLAG_NONE, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Data Length DATA_FLAG_NONE // Data Flags @@ -6148,7 +6150,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushCrossOriginCorrectness) { scoped_ptr<SpdyFrame> stream1_body(ConstructSpdyBodyFrame(1, true)); scoped_ptr<SpdyFrame> push_rst( - ConstructSpdyRstStream(2, REFUSED_STREAM)); + ConstructSpdyRstStream(2, RST_STREAM_REFUSED_STREAM)); MockWrite writes[] = { CreateMockWrite(*stream1_syn, 1), CreateMockWrite(*push_rst, 4), @@ -6163,7 +6165,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, ServerPushCrossOriginCorrectness) { 1, url_to_push)); scoped_ptr<SpdyFrame> rst( - ConstructSpdyRstStream(2, CANCEL)); + ConstructSpdyRstStream(2, RST_STREAM_CANCEL)); MockRead reads[] = { CreateMockRead(*stream1_reply, 2), @@ -6233,7 +6235,7 @@ TEST_P(SpdyNetworkTransactionSpdy3Test, RetryAfterRefused) { }; scoped_ptr<SpdyFrame> refused( - ConstructSpdyRstStream(1, REFUSED_STREAM)); + ConstructSpdyRstStream(1, RST_STREAM_REFUSED_STREAM)); scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 3)); scoped_ptr<SpdyFrame> body(ConstructSpdyBodyFrame(3, true)); MockRead reads[] = { diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h index b769709..0647ea1 100644 --- a/net/spdy/spdy_protocol.h +++ b/net/spdy/spdy_protocol.h @@ -411,24 +411,24 @@ enum SpdySettingsIds { SETTINGS_INITIAL_WINDOW_SIZE = 0x7 }; -// Status codes, as used in control frames (primarily RST_STREAM). -// TODO(hkhalil): Rename to SpdyRstStreamStatus -enum SpdyStatusCodes { - INVALID = 0, - PROTOCOL_ERROR = 1, - INVALID_STREAM = 2, - REFUSED_STREAM = 3, - UNSUPPORTED_VERSION = 4, - CANCEL = 5, - INTERNAL_ERROR = 6, - FLOW_CONTROL_ERROR = 7, - STREAM_IN_USE = 8, - STREAM_ALREADY_CLOSED = 9, - INVALID_CREDENTIALS = 10, - FRAME_TOO_LARGE = 11, - NUM_STATUS_CODES = 12 +// Status codes for RST_STREAM frames. +enum SpdyRstStreamStatus { + RST_STREAM_INVALID = 0, + RST_STREAM_PROTOCOL_ERROR = 1, + RST_STREAM_INVALID_STREAM = 2, + RST_STREAM_REFUSED_STREAM = 3, + RST_STREAM_UNSUPPORTED_VERSION = 4, + RST_STREAM_CANCEL = 5, + RST_STREAM_INTERNAL_ERROR = 6, + RST_STREAM_FLOW_CONTROL_ERROR = 7, + RST_STREAM_STREAM_IN_USE = 8, + RST_STREAM_STREAM_ALREADY_CLOSED = 9, + RST_STREAM_INVALID_CREDENTIALS = 10, + RST_STREAM_FRAME_TOO_LARGE = 11, + RST_STREAM_NUM_STATUS_CODES = 12 }; +// Status codes for GOAWAY frames. enum SpdyGoAwayStatus { GOAWAY_INVALID = -1, GOAWAY_OK = 0, @@ -812,15 +812,15 @@ class SpdyRstStreamControlFrame : public SpdyControlFrame { return ntohl(block()->stream_id_) & kStreamIdMask; } - SpdyStatusCodes status() const { - SpdyStatusCodes status = - static_cast<SpdyStatusCodes>(ntohl(block()->status_)); - if (status < INVALID || status >= NUM_STATUS_CODES) { - status = INVALID; + SpdyRstStreamStatus status() const { + SpdyRstStreamStatus status = + static_cast<SpdyRstStreamStatus>(ntohl(block()->status_)); + if (status < RST_STREAM_INVALID || status >= RST_STREAM_NUM_STATUS_CODES) { + status = RST_STREAM_INVALID; } return status; } - void set_status(SpdyStatusCodes status) { + void set_status(SpdyRstStreamStatus status) { mutable_block()->status_ = htonl(static_cast<uint32>(status)); } diff --git a/net/spdy/spdy_protocol_test.cc b/net/spdy/spdy_protocol_test.cc index 4b9bd15..5230659 100644 --- a/net/spdy/spdy_protocol_test.cc +++ b/net/spdy/spdy_protocol_test.cc @@ -116,14 +116,14 @@ TEST_P(SpdyProtocolTest, ControlFrameStructs) { EXPECT_EQ(0, syn_reply->flags()); scoped_ptr<SpdyRstStreamControlFrame> rst_frame( - framer.CreateRstStream(123, PROTOCOL_ERROR)); + framer.CreateRstStream(123, RST_STREAM_PROTOCOL_ERROR)); EXPECT_EQ(framer.protocol_version(), rst_frame->version()); EXPECT_TRUE(rst_frame->is_control_frame()); EXPECT_EQ(RST_STREAM, rst_frame->type()); EXPECT_EQ(123u, rst_frame->stream_id()); - EXPECT_EQ(PROTOCOL_ERROR, rst_frame->status()); - rst_frame->set_status(INVALID_STREAM); - EXPECT_EQ(INVALID_STREAM, rst_frame->status()); + EXPECT_EQ(RST_STREAM_PROTOCOL_ERROR, rst_frame->status()); + rst_frame->set_status(RST_STREAM_INVALID_STREAM); + EXPECT_EQ(RST_STREAM_INVALID_STREAM, rst_frame->status()); EXPECT_EQ(0, rst_frame->flags()); const uint32 kUniqueId = 1234567u; @@ -372,18 +372,19 @@ TEST_P(SpdyProtocolDeathTest, TestRstStreamStatusBounds) { SpdyFramer framer(spdy_version_); scoped_ptr<SpdyRstStreamControlFrame> rst_frame; - rst_frame.reset(framer.CreateRstStream(123, PROTOCOL_ERROR)); - EXPECT_EQ(PROTOCOL_ERROR, rst_frame->status()); + rst_frame.reset(framer.CreateRstStream( + 123, RST_STREAM_PROTOCOL_ERROR)); + EXPECT_EQ(RST_STREAM_PROTOCOL_ERROR, rst_frame->status()); - rst_frame->set_status(INVALID); - EXPECT_EQ(INVALID, rst_frame->status()); + rst_frame->set_status(RST_STREAM_INVALID); + EXPECT_EQ(RST_STREAM_INVALID, rst_frame->status()); - rst_frame->set_status( - static_cast<SpdyStatusCodes>(INVALID - 1)); - EXPECT_EQ(INVALID, rst_frame->status()); + rst_frame->set_status(static_cast<SpdyRstStreamStatus>( + RST_STREAM_INVALID - 1)); + EXPECT_EQ(RST_STREAM_INVALID, rst_frame->status()); - rst_frame->set_status(NUM_STATUS_CODES); - EXPECT_EQ(INVALID, rst_frame->status()); + rst_frame->set_status(RST_STREAM_NUM_STATUS_CODES); + EXPECT_EQ(RST_STREAM_INVALID, rst_frame->status()); } } // namespace net diff --git a/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc b/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc index 0b6a191..22cf8ae 100644 --- a/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc +++ b/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc @@ -325,7 +325,7 @@ SpdyProxyClientSocketSpdy2Test::ConstructConnectRequestFrame() { net::ConvertRequestPriorityToSpdyPriority(LOWEST, 2), CONTROL_FLAG_NONE, false, - INVALID, + RST_STREAM_INVALID, NULL, 0, DATA_FLAG_NONE @@ -352,7 +352,7 @@ SpdyProxyClientSocketSpdy2Test::ConstructConnectAuthRequestFrame() { net::ConvertRequestPriorityToSpdyPriority(LOWEST, 2), CONTROL_FLAG_NONE, false, - INVALID, + RST_STREAM_INVALID, NULL, 0, DATA_FLAG_NONE @@ -1262,7 +1262,7 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, RstWithReadAndWritePending) { }; scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*rst, 3, ASYNC), @@ -1384,7 +1384,7 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, RstWithReadAndWritePendingDelete) { }; scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*rst, 3, ASYNC), diff --git a/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc b/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc index 58a4fdc..05dc3fd 100644 --- a/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc +++ b/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc @@ -326,7 +326,7 @@ SpdyProxyClientSocketSpdy3Test::ConstructConnectRequestFrame() { 0, CONTROL_FLAG_NONE, false, - INVALID, + RST_STREAM_INVALID, NULL, 0, DATA_FLAG_NONE @@ -354,7 +354,7 @@ SpdyProxyClientSocketSpdy3Test::ConstructConnectAuthRequestFrame() { 0, CONTROL_FLAG_NONE, false, - INVALID, + RST_STREAM_INVALID, NULL, 0, DATA_FLAG_NONE @@ -1265,7 +1265,7 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, RstWithReadAndWritePending) { }; scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*rst, 3, ASYNC), @@ -1387,7 +1387,7 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, RstWithReadAndWritePendingDelete) { }; scoped_ptr<SpdyFrame> resp(ConstructConnectReplyFrame()); - scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, CANCEL)); + scoped_ptr<SpdyFrame> rst(ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); MockRead reads[] = { CreateMockRead(*resp, 1, ASYNC), CreateMockRead(*rst, 3, ASYNC), diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index 060b4e9..c6c25cd 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -739,7 +739,7 @@ void SpdySession::CloseCreatedStream(SpdyStream* stream, int status) { } void SpdySession::ResetStream(SpdyStreamId stream_id, - SpdyStatusCodes status, + SpdyRstStreamStatus status, const std::string& description) { net_log().AddEvent( NetLog::TYPE_SPDY_SESSION_SEND_RST_STREAM, @@ -1301,7 +1301,7 @@ void SpdySession::OnError(SpdyFramer::SpdyError error_code) { void SpdySession::OnStreamError(SpdyStreamId stream_id, const std::string& description) { if (IsStreamActive(stream_id)) - ResetStream(stream_id, PROTOCOL_ERROR, description); + ResetStream(stream_id, RST_STREAM_PROTOCOL_ERROR, description); } void SpdySession::OnStreamFrameData(SpdyStreamId stream_id, @@ -1398,7 +1398,7 @@ void SpdySession::OnSynStream(SpdyStreamId stream_id, std::string description = base::StringPrintf( "Received invalid OnSyn associated stream id %d for stream %d", associated_stream_id, stream_id); - ResetStream(stream_id, REFUSED_STREAM, description); + ResetStream(stream_id, RST_STREAM_REFUSED_STREAM, description); return; } @@ -1409,7 +1409,7 @@ void SpdySession::OnSynStream(SpdyStreamId stream_id, // Verify that the response had a URL for us. GURL gurl = GetUrlFromHeaderBlock(headers, GetProtocolVersion(), true); if (!gurl.is_valid()) { - ResetStream(stream_id, PROTOCOL_ERROR, + ResetStream(stream_id, RST_STREAM_PROTOCOL_ERROR, "Pushed stream url was invalid: " + gurl.spec()); return; } @@ -1417,7 +1417,7 @@ void SpdySession::OnSynStream(SpdyStreamId stream_id, // Verify we have a valid stream association. if (!IsStreamActive(associated_stream_id)) { - ResetStream(stream_id, INVALID_STREAM, + ResetStream(stream_id, RST_STREAM_INVALID_STREAM, base::StringPrintf( "Received OnSyn with inactive associated stream %d", associated_stream_id)); @@ -1430,7 +1430,7 @@ void SpdySession::OnSynStream(SpdyStreamId stream_id, if (trusted_spdy_proxy_.Equals(host_port_pair())) { // Disallow pushing of HTTPS content. if (gurl.SchemeIs("https")) { - ResetStream(stream_id, REFUSED_STREAM, + ResetStream(stream_id, RST_STREAM_REFUSED_STREAM, base::StringPrintf( "Rejected push of Cross Origin HTTPS content %d", associated_stream_id)); @@ -1440,7 +1440,7 @@ void SpdySession::OnSynStream(SpdyStreamId stream_id, active_streams_[associated_stream_id]; GURL associated_url(associated_stream->GetUrl()); if (associated_url.GetOrigin() != gurl.GetOrigin()) { - ResetStream(stream_id, REFUSED_STREAM, + ResetStream(stream_id, RST_STREAM_REFUSED_STREAM, base::StringPrintf( "Rejected Cross Origin Push Stream %d", associated_stream_id)); @@ -1451,7 +1451,7 @@ void SpdySession::OnSynStream(SpdyStreamId stream_id, // There should not be an existing pushed stream with the same path. PushedStreamMap::iterator it = unclaimed_pushed_streams_.find(url); if (it != unclaimed_pushed_streams_.end()) { - ResetStream(stream_id, PROTOCOL_ERROR, + ResetStream(stream_id, RST_STREAM_PROTOCOL_ERROR, "Received duplicate pushed stream with url: " + url); return; } @@ -1573,7 +1573,8 @@ void SpdySession::OnHeaders(SpdyStreamId stream_id, } } -void SpdySession::OnRstStream(SpdyStreamId stream_id, SpdyStatusCodes status) { +void SpdySession::OnRstStream(SpdyStreamId stream_id, + SpdyRstStreamStatus status) { std::string description; net_log().AddEvent( NetLog::TYPE_SPDY_SESSION_RST_STREAM, @@ -1591,7 +1592,7 @@ void SpdySession::OnRstStream(SpdyStreamId stream_id, SpdyStatusCodes status) { if (status == 0) { stream->OnDataReceived(NULL, 0); - } else if (status == REFUSED_STREAM) { + } else if (status == RST_STREAM_REFUSED_STREAM) { DeleteStream(stream_id, ERR_SPDY_SERVER_REFUSED_STREAM); } else { RecordProtocolErrorHistogram( @@ -1665,7 +1666,7 @@ void SpdySession::OnWindowUpdate(SpdyStreamId stream_id, } if (delta_window_size < 1) { - ResetStream(stream_id, FLOW_CONTROL_ERROR, + ResetStream(stream_id, RST_STREAM_FLOW_CONTROL_ERROR, base::StringPrintf( "Received WINDOW_UPDATE with an invalid " "delta_window_size %d", delta_window_size)); diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h index 799da46..e2c73ed 100644 --- a/net/spdy/spdy_session.h +++ b/net/spdy/spdy_session.h @@ -64,7 +64,7 @@ enum SpdyProtocolErrorDetails { SPDY_ERROR_CREDENTIAL_FRAME_CORRUPT, SPDY_ERROR_INVALID_DATA_FRAME_FLAGS, - // SpdyStatusCodes + // SpdyRstStreamStatus STATUS_CODE_INVALID, STATUS_CODE_PROTOCOL_ERROR, STATUS_CODE_INVALID_STREAM, @@ -92,8 +92,8 @@ COMPILE_ASSERT(STATUS_CODE_INVALID == SpdyProtocolErrorDetails_SpdyErrors_mismatch); COMPILE_ASSERT(PROTOCOL_ERROR_UNEXPECTED_PING == - static_cast<SpdyProtocolErrorDetails>(NUM_STATUS_CODES + - STATUS_CODE_INVALID), + static_cast<SpdyProtocolErrorDetails>( + RST_STREAM_NUM_STATUS_CODES + STATUS_CODE_INVALID), SpdyProtocolErrorDetails_SpdyErrors_mismatch); class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, @@ -241,7 +241,7 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, // Also closes the stream. Was not piggybacked to CloseStream since not // all of the calls to CloseStream necessitate sending a RST_STREAM. void ResetStream(SpdyStreamId stream_id, - SpdyStatusCodes status, + SpdyRstStreamStatus status, const std::string& description); // Check if a stream is active. @@ -543,7 +543,7 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, const std::string& description) OVERRIDE; virtual void OnPing(uint32 unique_id) OVERRIDE; virtual void OnRstStream(SpdyStreamId stream_id, - SpdyStatusCodes status) OVERRIDE; + SpdyRstStreamStatus status) OVERRIDE; virtual void OnGoAway(SpdyStreamId last_accepted_stream_id, SpdyGoAwayStatus status) OVERRIDE; virtual void OnStreamFrameData(SpdyStreamId stream_id, diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc index 91928fe..e9823ad 100644 --- a/net/spdy/spdy_stream.cc +++ b/net/spdy/spdy_stream.cc @@ -272,7 +272,7 @@ void SpdyStream::IncreaseSendWindowSize(int32 delta_window_size) { "Received WINDOW_UPDATE [delta: %d] for stream %d overflows " "send_window_size_ [current: %d]", delta_window_size, stream_id_, send_window_size_); - session_->ResetStream(stream_id_, FLOW_CONTROL_ERROR, desc); + session_->ResetStream(stream_id_, RST_STREAM_FLOW_CONTROL_ERROR, desc); return; } @@ -347,7 +347,7 @@ void SpdyStream::DecreaseRecvWindowSize(int32 delta_window_size) { // a negative |recv_window_size_|, if we do, it's a client side bug, so we use // PROTOCOL_ERROR for lack of a better error code. if (recv_window_size_ < 0) { - session_->ResetStream(stream_id_, PROTOCOL_ERROR, + session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, "Negative recv window size"); NOTREACHED(); } @@ -397,7 +397,7 @@ int SpdyStream::OnResponseReceived(const SpdyHeaderBlock& response) { it != response.end(); ++it) { // Disallow uppercase headers. if (ContainsUpperAscii(it->first)) { - session_->ResetStream(stream_id_, PROTOCOL_ERROR, + session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, "Upper case characters in header: " + it->first); response_status_ = ERR_SPDY_PROTOCOL_ERROR; return ERR_SPDY_PROTOCOL_ERROR; @@ -405,7 +405,7 @@ int SpdyStream::OnResponseReceived(const SpdyHeaderBlock& response) { } if ((*response_).find("transfer-encoding") != (*response_).end()) { - session_->ResetStream(stream_id_, PROTOCOL_ERROR, + session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, "Received transfer-encoding header"); return ERR_SPDY_PROTOCOL_ERROR; } @@ -433,7 +433,7 @@ int SpdyStream::OnHeaders(const SpdyHeaderBlock& headers) { // Disallow uppercase headers. if (ContainsUpperAscii(it->first)) { - session_->ResetStream(stream_id_, PROTOCOL_ERROR, + session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, "Upper case characters in header: " + it->first); response_status_ = ERR_SPDY_PROTOCOL_ERROR; return ERR_SPDY_PROTOCOL_ERROR; @@ -443,7 +443,7 @@ int SpdyStream::OnHeaders(const SpdyHeaderBlock& headers) { } if ((*response_).find("transfer-encoding") != (*response_).end()) { - session_->ResetStream(stream_id_, PROTOCOL_ERROR, + session_->ResetStream(stream_id_, RST_STREAM_PROTOCOL_ERROR, "Received transfer-encoding header"); return ERR_SPDY_PROTOCOL_ERROR; } @@ -555,9 +555,9 @@ void SpdyStream::Cancel() { cancelled_ = true; if (session_->IsStreamActive(stream_id_)) - session_->ResetStream(stream_id_, CANCEL, ""); + session_->ResetStream(stream_id_, RST_STREAM_CANCEL, ""); else if (stream_id_ == 0) - session_->CloseCreatedStream(this, CANCEL); + session_->CloseCreatedStream(this, RST_STREAM_CANCEL); } void SpdyStream::Close() { diff --git a/net/spdy/spdy_stream_spdy2_unittest.cc b/net/spdy/spdy_stream_spdy2_unittest.cc index 602ff31..4473d02 100644 --- a/net/spdy/spdy_stream_spdy2_unittest.cc +++ b/net/spdy/spdy_stream_spdy2_unittest.cc @@ -64,7 +64,7 @@ TEST_F(SpdyStreamSpdy2Test, SendDataAfterOpen) { ConvertRequestPriorityToSpdyPriority(LOWEST, 2), CONTROL_FLAG_NONE, false, - INVALID, + RST_STREAM_INVALID, NULL, 0, DATA_FLAG_NONE @@ -335,7 +335,7 @@ TEST_F(SpdyStreamSpdy2Test, StreamError) { ConvertRequestPriorityToSpdyPriority(LOWEST, 2), CONTROL_FLAG_NONE, false, - INVALID, + RST_STREAM_INVALID, NULL, 0, DATA_FLAG_NONE diff --git a/net/spdy/spdy_stream_spdy3_unittest.cc b/net/spdy/spdy_stream_spdy3_unittest.cc index 3b07ea4..8e89d03 100644 --- a/net/spdy/spdy_stream_spdy3_unittest.cc +++ b/net/spdy/spdy_stream_spdy3_unittest.cc @@ -65,7 +65,7 @@ TEST_F(SpdyStreamSpdy3Test, SendDataAfterOpen) { 0, CONTROL_FLAG_NONE, false, - INVALID, + RST_STREAM_INVALID, NULL, 0, DATA_FLAG_NONE @@ -340,7 +340,7 @@ TEST_F(SpdyStreamSpdy3Test, StreamError) { 0, CONTROL_FLAG_NONE, false, - INVALID, + RST_STREAM_INVALID, NULL, 0, DATA_FLAG_NONE diff --git a/net/spdy/spdy_test_util_spdy2.cc b/net/spdy/spdy_test_util_spdy2.cc index 967f4c2..895a0e8 100644 --- a/net/spdy/spdy_test_util_spdy2.cc +++ b/net/spdy/spdy_test_util_spdy2.cc @@ -251,7 +251,7 @@ SpdyFrame* ConstructSpdyWindowUpdate( // Construct a SPDY RST_STREAM frame. // Returns the constructed frame. The caller takes ownership of the frame. SpdyFrame* ConstructSpdyRstStream(SpdyStreamId stream_id, - SpdyStatusCodes status) { + SpdyRstStreamStatus status) { BufferedSpdyFramer framer(2, false); return framer.CreateRstStream(stream_id, status); } @@ -335,7 +335,7 @@ SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], // Priority flags, // Control Flags compressed, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags @@ -364,7 +364,7 @@ SpdyFrame* ConstructSpdyGet(const char* const url, // Priority CONTROL_FLAG_FIN, // Control Flags compressed, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags @@ -979,7 +979,7 @@ const SpdyHeaderInfo MakeSpdyHeader(SpdyControlType type) { ConvertRequestPriorityToSpdyPriority(LOWEST, 2), // Priority CONTROL_FLAG_FIN, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags diff --git a/net/spdy/spdy_test_util_spdy2.h b/net/spdy/spdy_test_util_spdy2.h index cfacdd2..383ad825 100644 --- a/net/spdy/spdy_test_util_spdy2.h +++ b/net/spdy/spdy_test_util_spdy2.h @@ -42,7 +42,7 @@ struct SpdyHeaderInfo { SpdyPriority priority; SpdyControlFlags control_flags; bool compressed; - SpdyStatusCodes status; + SpdyRstStreamStatus status; const char* data; uint32 data_length; SpdyDataFlags data_flags; @@ -179,7 +179,7 @@ SpdyFrame* ConstructSpdyWindowUpdate(SpdyStreamId, uint32 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, - SpdyStatusCodes status); + SpdyRstStreamStatus status); // Construct a single SPDY header entry, for validation. // |extra_headers| are the extra header-value pairs. diff --git a/net/spdy/spdy_test_util_spdy3.cc b/net/spdy/spdy_test_util_spdy3.cc index 268b6d5..f2e09f8 100644 --- a/net/spdy/spdy_test_util_spdy3.cc +++ b/net/spdy/spdy_test_util_spdy3.cc @@ -296,7 +296,7 @@ SpdyFrame* ConstructSpdyWindowUpdate( // Construct a SPDY RST_STREAM frame. // Returns the constructed frame. The caller takes ownership of the frame. SpdyFrame* ConstructSpdyRstStream(SpdyStreamId stream_id, - SpdyStatusCodes status) { + SpdyRstStreamStatus status) { BufferedSpdyFramer framer(3, false); return framer.CreateRstStream(stream_id, status); } @@ -381,7 +381,7 @@ SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[], 0, // Credential Slot flags, // Control Flags compressed, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags @@ -411,7 +411,7 @@ SpdyFrame* ConstructSpdyGet(const char* const url, 0, // Credential Slot CONTROL_FLAG_FIN, // Control Flags compressed, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags @@ -1024,7 +1024,7 @@ const SpdyHeaderInfo MakeSpdyHeader(SpdyControlType type) { 0, // Credential Slot CONTROL_FLAG_FIN, // Control Flags false, // Compressed - INVALID, // Status + RST_STREAM_INVALID, // Status NULL, // Data 0, // Length DATA_FLAG_NONE // Data Flags diff --git a/net/spdy/spdy_test_util_spdy3.h b/net/spdy/spdy_test_util_spdy3.h index 24abd60..da6fa5b 100644 --- a/net/spdy/spdy_test_util_spdy3.h +++ b/net/spdy/spdy_test_util_spdy3.h @@ -50,7 +50,7 @@ struct SpdyHeaderInfo { size_t credential_slot; SpdyControlFlags control_flags; bool compressed; - SpdyStatusCodes status; + SpdyRstStreamStatus status; const char* data; uint32 data_length; SpdyDataFlags data_flags; @@ -219,7 +219,7 @@ SpdyFrame* ConstructSpdyWindowUpdate(SpdyStreamId, uint32 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, - SpdyStatusCodes status); + SpdyRstStreamStatus status); // Construct a single SPDY header entry, for validation. // |extra_headers| are the extra header-value pairs. diff --git a/net/spdy/spdy_websocket_test_util_spdy2.cc b/net/spdy/spdy_websocket_test_util_spdy2.cc index 1a45949..995f681 100644 --- a/net/spdy/spdy_websocket_test_util_spdy2.cc +++ b/net/spdy/spdy_websocket_test_util_spdy2.cc @@ -76,7 +76,7 @@ SpdyFrame* ConstructSpdyWebSocketHandshakeRequestFrame( ConvertRequestPriorityToSpdyPriority(request_priority, 2), CONTROL_FLAG_NONE, kDefaultCompressed, - INVALID, + RST_STREAM_INVALID, kDefaultDataPointer, kDefaultDataLength, DATA_FLAG_NONE @@ -105,7 +105,7 @@ SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( ConvertRequestPriorityToSpdyPriority(request_priority, 2), CONTROL_FLAG_NONE, kDefaultCompressed, - INVALID, + RST_STREAM_INVALID, kDefaultDataPointer, kDefaultDataLength, DATA_FLAG_NONE diff --git a/net/spdy/spdy_websocket_test_util_spdy3.cc b/net/spdy/spdy_websocket_test_util_spdy3.cc index 4e2eec4..006459b 100644 --- a/net/spdy/spdy_websocket_test_util_spdy3.cc +++ b/net/spdy/spdy_websocket_test_util_spdy3.cc @@ -78,7 +78,7 @@ SpdyFrame* ConstructSpdyWebSocketHandshakeRequestFrame( kDefaultCredentialSlot, CONTROL_FLAG_NONE, kDefaultCompressed, - INVALID, + RST_STREAM_INVALID, kDefaultDataPointer, kDefaultDataLength, DATA_FLAG_NONE @@ -108,7 +108,7 @@ SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( kDefaultCredentialSlot, CONTROL_FLAG_NONE, kDefaultCompressed, - INVALID, + RST_STREAM_INVALID, kDefaultDataPointer, kDefaultDataLength, DATA_FLAG_NONE diff --git a/net/tools/flip_server/spdy_interface.cc b/net/tools/flip_server/spdy_interface.cc index d6ea40a..b112883 100644 --- a/net/tools/flip_server/spdy_interface.cc +++ b/net/tools/flip_server/spdy_interface.cc @@ -255,7 +255,7 @@ void SpdySM::OnHeaders(SpdyStreamId stream_id, } void SpdySM::OnRstStream(SpdyStreamId stream_id, - SpdyStatusCodes status) { + SpdyRstStreamStatus status) { VLOG(2) << ACCEPTOR_CLIENT_IDENT << "SpdySM: OnRstStream(" << stream_id << ")"; client_output_ordering_.RemoveStreamId(stream_id); diff --git a/net/tools/flip_server/spdy_interface.h b/net/tools/flip_server/spdy_interface.h index 6751bf1..a6c725d 100644 --- a/net/tools/flip_server/spdy_interface.h +++ b/net/tools/flip_server/spdy_interface.h @@ -101,7 +101,7 @@ class SpdySM : public BufferedSpdyFramerVisitorInterface, // Called when a RST_STREAM frame has been parsed. virtual void OnRstStream(SpdyStreamId stream_id, - SpdyStatusCodes status) OVERRIDE; + SpdyRstStreamStatus status) OVERRIDE; // Called when a GOAWAY frame has been parsed. virtual void OnGoAway(SpdyStreamId last_accepted_stream_id, |