diff options
author | bnc <bnc@chromium.org> | 2014-11-07 12:29:43 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-07 20:30:58 +0000 |
commit | 83a189f34e8b84d6a3c3cee2a42ceec8dc60dbdd (patch) | |
tree | 72ccbb7ed8bda533887d61dae0cd9640f0458d47 /net/tools/flip_server | |
parent | ce072870c3bae8eccdfaa14e3bd9570ca2de20bf (diff) | |
download | chromium_src-83a189f34e8b84d6a3c3cee2a42ceec8dc60dbdd.zip chromium_src-83a189f34e8b84d6a3c3cee2a42ceec8dc60dbdd.tar.gz chromium_src-83a189f34e8b84d6a3c3cee2a42ceec8dc60dbdd.tar.bz2 |
Report HTTP/2 HEADERS frames as HEADERS, not SYN_STREAM.
Previously, Framer passed HTTP/2 HEADERS frames with priority as SYN_STREAM to the
visitor. This is not correct because (1) we could get headers opening a stream
with no priority set, (2) HTTP/2 does not have SYN_STREAM frames anyway.
This CL makes the Framer report HTTP/2 HEADERS as HEADERS, and pass priority along. SPDY/3 functionality is unchanged.
This CL includes server change 79116025 by mlavan (changes to spdy_framer* expect for Patch Set 3), and server change 79432157 by bnc (Patch Set 3).
BUG=345769
Review URL: https://codereview.chromium.org/698323002
Cr-Commit-Position: refs/heads/master@{#303285}
Diffstat (limited to 'net/tools/flip_server')
-rw-r--r-- | net/tools/flip_server/spdy_interface.cc | 2 | ||||
-rw-r--r-- | net/tools/flip_server/spdy_interface.h | 2 | ||||
-rw-r--r-- | net/tools/flip_server/spdy_interface_test.cc | 31 |
3 files changed, 24 insertions, 11 deletions
diff --git a/net/tools/flip_server/spdy_interface.cc b/net/tools/flip_server/spdy_interface.cc index 297045d..22da7db 100644 --- a/net/tools/flip_server/spdy_interface.cc +++ b/net/tools/flip_server/spdy_interface.cc @@ -285,6 +285,8 @@ void SpdySM::OnSynReply(SpdyStreamId stream_id, } void SpdySM::OnHeaders(SpdyStreamId stream_id, + bool has_priority, + SpdyPriority priority, bool fin, const SpdyHeaderBlock& headers) { VLOG(2) << ACCEPTOR_CLIENT_IDENT << "SpdySM: OnHeaders(" << stream_id << ")"; diff --git a/net/tools/flip_server/spdy_interface.h b/net/tools/flip_server/spdy_interface.h index de53e87..15cf0e9 100644 --- a/net/tools/flip_server/spdy_interface.h +++ b/net/tools/flip_server/spdy_interface.h @@ -81,6 +81,8 @@ class SpdySM : public BufferedSpdyFramerVisitorInterface, public SMInterface { // Called after all the header data for HEADERS control frame is received. void OnHeaders(SpdyStreamId stream_id, + bool has_priority, + SpdyPriority priority, bool fin, const SpdyHeaderBlock& headers) override; diff --git a/net/tools/flip_server/spdy_interface_test.cc b/net/tools/flip_server/spdy_interface_test.cc index 9e66d0c..09909e2 100644 --- a/net/tools/flip_server/spdy_interface_test.cc +++ b/net/tools/flip_server/spdy_interface_test.cc @@ -52,7 +52,12 @@ class SpdyFramerVisitor : public BufferedSpdyFramerVisitorInterface { bool, const SpdyHeaderBlock&)); MOCK_METHOD3(OnSynReply, void(SpdyStreamId, bool, const SpdyHeaderBlock&)); - MOCK_METHOD3(OnHeaders, void(SpdyStreamId, bool, const SpdyHeaderBlock&)); + MOCK_METHOD5(OnHeaders, + void(SpdyStreamId, + bool, + SpdyPriority, + bool, + const SpdyHeaderBlock&)); MOCK_METHOD3(OnDataFrameHeader, void(SpdyStreamId, size_t, bool)); MOCK_METHOD4(OnStreamFrameData, void(SpdyStreamId, const char*, @@ -471,8 +476,9 @@ TEST_P(SpdySMProxyTest, SendErrorNotFound_SPDY2) { EXPECT_CALL(*spdy_framer_visitor_, OnSynReply(stream_id, false, _)) .WillOnce(SaveArg<2>(&actual_header_block)); } else { - EXPECT_CALL(*spdy_framer_visitor_, OnHeaders(stream_id, false, _)) - .WillOnce(SaveArg<2>(&actual_header_block)); + EXPECT_CALL(*spdy_framer_visitor_, + OnHeaders(stream_id, false, 0, false, _)) + .WillOnce(SaveArg<4>(&actual_header_block)); } EXPECT_CALL(checkpoint, Call(0)); EXPECT_CALL(*spdy_framer_visitor_, @@ -522,8 +528,8 @@ TEST_P(SpdySMProxyTest, SendErrorNotFound) { .WillOnce(SaveArg<2>(&actual_header_block)); } else { EXPECT_CALL(*spdy_framer_visitor_, - OnHeaders(stream_id, false, _)) - .WillOnce(SaveArg<2>(&actual_header_block)); + OnHeaders(stream_id, false, 0, false, _)) + .WillOnce(SaveArg<4>(&actual_header_block)); } EXPECT_CALL(checkpoint, Call(0)); EXPECT_CALL(*spdy_framer_visitor_, @@ -641,8 +647,9 @@ TEST_P(SpdySMProxyTest, SendSynReply_SPDY2) { EXPECT_CALL(*spdy_framer_visitor_, OnSynReply(stream_id, false, _)) .WillOnce(SaveArg<2>(&actual_header_block)); } else { - EXPECT_CALL(*spdy_framer_visitor_, OnHeaders(stream_id, false, _)) - .WillOnce(SaveArg<2>(&actual_header_block)); + EXPECT_CALL(*spdy_framer_visitor_, + OnHeaders(stream_id, false, 0, false, _)) + .WillOnce(SaveArg<4>(&actual_header_block)); } } @@ -677,8 +684,9 @@ TEST_P(SpdySMProxyTest, SendSynReply) { EXPECT_CALL(*spdy_framer_visitor_, OnSynReply(stream_id, false, _)) .WillOnce(SaveArg<2>(&actual_header_block)); } else { - EXPECT_CALL(*spdy_framer_visitor_, OnHeaders(stream_id, false, _)) - .WillOnce(SaveArg<2>(&actual_header_block)); + EXPECT_CALL(*spdy_framer_visitor_, + OnHeaders(stream_id, false, 0, false, _)) + .WillOnce(SaveArg<4>(&actual_header_block)); } } @@ -854,8 +862,9 @@ TEST_P(SpdySMServerTest, NewStreamError) { EXPECT_CALL(*spdy_framer_visitor_, OnSynReply(stream_id, false, _)) .WillOnce(SaveArg<2>(&actual_header_block)); } else { - EXPECT_CALL(*spdy_framer_visitor_, OnHeaders(stream_id, false, _)) - .WillOnce(SaveArg<2>(&actual_header_block)); + EXPECT_CALL(*spdy_framer_visitor_, + OnHeaders(stream_id, false, 0, false, _)) + .WillOnce(SaveArg<4>(&actual_header_block)); } EXPECT_CALL(checkpoint, Call(0)); EXPECT_CALL(*spdy_framer_visitor_, |