diff options
author | jgraettinger@chromium.org <jgraettinger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-30 06:11:31 +0000 |
---|---|---|
committer | jgraettinger@chromium.org <jgraettinger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-30 06:11:31 +0000 |
commit | dcaebbf0cb3dd5a2cbee521f4fa9bda719796ae3 (patch) | |
tree | 448b8eeba43456fba737bb8731ea26acc7b8a8d7 /net/tools/flip_server | |
parent | 0cc93b40bd1634eeb8365298f0776156cc15d309 (diff) | |
download | chromium_src-dcaebbf0cb3dd5a2cbee521f4fa9bda719796ae3.zip chromium_src-dcaebbf0cb3dd5a2cbee521f4fa9bda719796ae3.tar.gz chromium_src-dcaebbf0cb3dd5a2cbee521f4fa9bda719796ae3.tar.bz2 |
SPDY cleanup: remove credential slot.
Credential slot field has been removed from SYN_STREAM frame.
This lands server change 59587408 by mlavan.
Also update affected Chromium portions of QUIC & SPDY.
Review URL: https://codereview.chromium.org/141953004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247849 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools/flip_server')
-rw-r--r-- | net/tools/flip_server/spdy_interface.cc | 27 | ||||
-rw-r--r-- | net/tools/flip_server/spdy_interface.h | 1 | ||||
-rw-r--r-- | net/tools/flip_server/spdy_interface_test.cc | 70 |
3 files changed, 61 insertions, 37 deletions
diff --git a/net/tools/flip_server/spdy_interface.cc b/net/tools/flip_server/spdy_interface.cc index 41ad430..e462ca6 100644 --- a/net/tools/flip_server/spdy_interface.cc +++ b/net/tools/flip_server/spdy_interface.cc @@ -130,7 +130,6 @@ int SpdySM::SpdyHandleNewStream(SpdyStreamId stream_id, VLOG(2) << ACCEPTOR_CLIENT_IDENT << "SpdySM: OnSyn(" << stream_id << ")"; VLOG(2) << ACCEPTOR_CLIENT_IDENT << "SpdySM: # headers: " << headers.size(); - SpdyHeaderBlock supplement; SpdyHeaderBlock::const_iterator method = headers.end(); SpdyHeaderBlock::const_iterator host = headers.end(); SpdyHeaderBlock::const_iterator path = headers.end(); @@ -138,6 +137,8 @@ int SpdySM::SpdyHandleNewStream(SpdyStreamId stream_id, SpdyHeaderBlock::const_iterator version = headers.end(); SpdyHeaderBlock::const_iterator url = headers.end(); + std::string path_string, host_string, version_string; + if (spdy_version() == SPDY2) { url = headers.find("url"); method = headers.find("method"); @@ -153,22 +154,23 @@ int SpdySM::SpdyHandleNewStream(SpdyStreamId stream_id, // path contains a query string with a http:// in one of its values, // UrlUtilities::GetUrlPath will fail and always return a / breaking // the request. GetUrlPath assumes the absolute URL is being passed in. - std::string path_string = UrlUtilities::GetUrlPath(url->second); - std::string host_string = UrlUtilities::GetUrlHost(url->second); - path = supplement.insert(std::make_pair(":path", path_string)).first; - host = supplement.insert(std::make_pair(":host", host_string)).first; + path_string = UrlUtilities::GetUrlPath(url->second); + host_string = UrlUtilities::GetUrlHost(url->second); + version_string = version->second; } else { method = headers.find(":method"); host = headers.find(":host"); path = headers.find(":path"); scheme = headers.find(":scheme"); - version = supplement.insert(std::make_pair(":version", "HTTP/1.1")).first; if (method == headers.end() || host == headers.end() || path == headers.end() || scheme == headers.end()) { VLOG(2) << ACCEPTOR_CLIENT_IDENT << "SpdySM: A mandatory header is " << "missing. Not creating stream"; return 0; } + host_string = host->second; + path_string = path->second; + version_string = "HTTP/1.1"; } if (scheme->second.compare("https") == 0) { @@ -177,16 +179,16 @@ int SpdySM::SpdyHandleNewStream(SpdyStreamId stream_id, if (acceptor_->flip_handler_type_ == FLIP_HANDLER_SPDY_SERVER) { VLOG(1) << ACCEPTOR_CLIENT_IDENT << "Request: " << method->second - << " " << path->second; - std::string filename = EncodeURL(path->second, - host->second, + << " " << path_string; + std::string filename = EncodeURL(path_string, + host_string, method->second); NewStream(stream_id, priority, filename); } else { http_data += - method->second + " " + path->second + " " + version->second + "\r\n"; + method->second + " " + path_string + " " + version_string + "\r\n"; VLOG(1) << ACCEPTOR_CLIENT_IDENT << "Request: " << method->second << " " - << path->second << " " << version->second; + << path_string << " " << version_string; http_data += "Host: " + (*is_https_scheme ? acceptor_->https_server_ip_ : acceptor_->http_server_ip_) + "\r\n"; @@ -241,7 +243,6 @@ void SpdySM::OnStreamFrameData(SpdyStreamId stream_id, void SpdySM::OnSynStream(SpdyStreamId stream_id, SpdyStreamId associated_stream_id, SpdyPriority priority, - uint8 credential_slot, bool fin, bool unidirectional, const SpdyHeaderBlock& headers) { @@ -470,7 +471,7 @@ size_t SpdySM::SendSynStreamImpl(uint32 stream_id, } SpdyFrame* fsrcf = buffered_spdy_framer_->CreateSynStream( - stream_id, 0, 0, 0, CONTROL_FLAG_NONE, &block); + stream_id, 0, 0, CONTROL_FLAG_NONE, &block); size_t df_size = fsrcf->size(); EnqueueDataFrame(new SpdyFrameDataFrame(fsrcf)); diff --git a/net/tools/flip_server/spdy_interface.h b/net/tools/flip_server/spdy_interface.h index 6e5ad0b..5528395 100644 --- a/net/tools/flip_server/spdy_interface.h +++ b/net/tools/flip_server/spdy_interface.h @@ -66,7 +66,6 @@ class SpdySM : public BufferedSpdyFramerVisitorInterface, public SMInterface { virtual void OnSynStream(SpdyStreamId stream_id, SpdyStreamId associated_stream_id, SpdyPriority priority, - uint8 credential_slot, bool fin, bool unidirectional, 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 3b98852..389f06b 100644 --- a/net/tools/flip_server/spdy_interface_test.cc +++ b/net/tools/flip_server/spdy_interface_test.cc @@ -44,15 +44,13 @@ class SpdyFramerVisitor : public BufferedSpdyFramerVisitorInterface { virtual ~SpdyFramerVisitor() {} MOCK_METHOD1(OnError, void(SpdyFramer::SpdyError)); MOCK_METHOD2(OnStreamError, void(SpdyStreamId, const std::string&)); - MOCK_METHOD7(OnSynStream, + MOCK_METHOD6(OnSynStream, void(SpdyStreamId, SpdyStreamId, SpdyPriority, - uint8, bool, bool, const SpdyHeaderBlock&)); - MOCK_METHOD3(OnSynStream, void(SpdyStreamId, bool, const SpdyHeaderBlock&)); MOCK_METHOD3(OnSynReply, void(SpdyStreamId, bool, const SpdyHeaderBlock&)); MOCK_METHOD3(OnHeaders, void(SpdyStreamId, bool, const SpdyHeaderBlock&)); MOCK_METHOD3(OnDataFrameHeader, void(SpdyStreamId, size_t, bool)); @@ -243,7 +241,7 @@ TEST_P(SpdySMProxyTest, OnSynStream_SPDY2) { InvokeWithoutArgs(&saver, &StringSaver::Save), Return(0))); } - visitor->OnSynStream(stream_id, associated_id, 0, 0, false, false, block); + visitor->OnSynStream(stream_id, associated_id, 0, false, false, block); ASSERT_EQ(expected, saver.string); } @@ -278,7 +276,7 @@ TEST_P(SpdySMProxyTest, OnSynStream) { InvokeWithoutArgs(&saver, &StringSaver::Save), Return(0))); } - visitor->OnSynStream(stream_id, associated_id, 0, 0, false, false, block); + visitor->OnSynStream(stream_id, associated_id, 0, false, false, block); ASSERT_EQ(expected, saver.string); } @@ -310,7 +308,7 @@ TEST_P(SpdySMProxyTest, OnStreamFrameData_SPDY2) { ProcessWriteInput(frame->data(), frame->size())).Times(1); } - visitor->OnSynStream(stream_id, associated_id, 0, 0, false, false, block); + visitor->OnSynStream(stream_id, associated_id, 0, false, false, block); checkpoint.Call(0); visitor->OnStreamFrameData(stream_id, frame->data(), frame->size(), true); } @@ -345,7 +343,7 @@ TEST_P(SpdySMProxyTest, OnStreamFrameData) { ProcessWriteInput(frame->data(), frame->size())).Times(1); } - visitor->OnSynStream(stream_id, associated_id, 0, 0, false, false, block); + visitor->OnSynStream(stream_id, associated_id, 0, false, false, block); checkpoint.Call(0); visitor->OnStreamFrameData(stream_id, frame->data(), frame->size(), true); } @@ -455,8 +453,13 @@ TEST_P(SpdySMProxyTest, SendErrorNotFound_SPDY2) { { InSequence s; - EXPECT_CALL(*spdy_framer_visitor_, OnSynReply(stream_id, false, _)) - .WillOnce(SaveArg<2>(&actual_header_block)); + if (GetParam() < SPDY4) { + 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(checkpoint, Call(0)); EXPECT_CALL(*spdy_framer_visitor_, OnDataFrameHeader(stream_id, _, true)); @@ -499,9 +502,15 @@ TEST_P(SpdySMProxyTest, SendErrorNotFound) { { InSequence s; - EXPECT_CALL(*spdy_framer_visitor_, - OnSynReply(stream_id, false, _)) - .WillOnce(SaveArg<2>(&actual_header_block)); + if (GetParam() < SPDY4) { + 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(checkpoint, Call(0)); EXPECT_CALL(*spdy_framer_visitor_, OnDataFrameHeader(stream_id, _, true)); @@ -547,8 +556,8 @@ TEST_P(SpdySMProxyTest, SendSynStream_SPDY2) { { InSequence s; EXPECT_CALL(*spdy_framer_visitor_, - OnSynStream(stream_id, 0, _, _, false, false, _)) - .WillOnce(SaveArg<6>(&actual_header_block)); + OnSynStream(stream_id, 0, _, false, false, _)) + .WillOnce(SaveArg<5>(&actual_header_block)); } spdy_framer_->ProcessInput(df->data, df->size); @@ -581,8 +590,8 @@ TEST_P(SpdySMProxyTest, SendSynStream) { { InSequence s; EXPECT_CALL(*spdy_framer_visitor_, - OnSynStream(stream_id, 0, _, _, false, false, _)) - .WillOnce(SaveArg<6>(&actual_header_block)); + OnSynStream(stream_id, 0, _, false, false, _)) + .WillOnce(SaveArg<5>(&actual_header_block)); } spdy_framer_->ProcessInput(df->data, df->size); @@ -614,8 +623,13 @@ TEST_P(SpdySMProxyTest, SendSynReply_SPDY2) { { InSequence s; - EXPECT_CALL(*spdy_framer_visitor_, OnSynReply(stream_id, false, _)) - .WillOnce(SaveArg<2>(&actual_header_block)); + if (GetParam() < SPDY4) { + 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)); + } } spdy_framer_->ProcessInput(df->data, df->size); @@ -645,8 +659,13 @@ TEST_P(SpdySMProxyTest, SendSynReply) { { InSequence s; - EXPECT_CALL(*spdy_framer_visitor_, OnSynReply(stream_id, false, _)) - .WillOnce(SaveArg<2>(&actual_header_block)); + if (GetParam() < SPDY4) { + 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)); + } } spdy_framer_->ProcessInput(df->data, df->size); @@ -787,7 +806,7 @@ TEST_P(SpdySMServerTest, OnSynStream) { BalsaHeaders headers; memory_cache_->InsertFile(&headers, "GET_/path", ""); } - visitor->OnSynStream(stream_id, 0, 0, 0, true, true, spdy_headers); + visitor->OnSynStream(stream_id, 0, 0, true, true, spdy_headers); ASSERT_TRUE(HasStream(stream_id)); } @@ -817,8 +836,13 @@ TEST_P(SpdySMServerTest, NewStreamError) { { InSequence s; - EXPECT_CALL(*spdy_framer_visitor_, OnSynReply(stream_id, false, _)) - .WillOnce(SaveArg<2>(&actual_header_block)); + if (GetParam() < SPDY4) { + 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(checkpoint, Call(0)); EXPECT_CALL(*spdy_framer_visitor_, OnDataFrameHeader(stream_id, _, true)); |