diff options
author | mbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-03 03:51:29 +0000 |
---|---|---|
committer | mbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-03 03:51:29 +0000 |
commit | fdc165a57f556130cf1d2c9d5070cbda6c299258 (patch) | |
tree | c3549c0056b18bffebc2e0aa2aacb9b45f6f25a5 /net/spdy/spdy_session.cc | |
parent | b37b4abf9766b35bb6c96a54aa3c86085aa53e11 (diff) | |
download | chromium_src-fdc165a57f556130cf1d2c9d5070cbda6c299258.zip chromium_src-fdc165a57f556130cf1d2c9d5070cbda6c299258.tar.gz chromium_src-fdc165a57f556130cf1d2c9d5070cbda6c299258.tar.bz2 |
Fix Server Push bug; we properly detected the duplicate SYN, but we forgot to
break out, so we leaked the stream. Also add a netlog entry for the case where
we max out the active stream limit.
BUG=none
TEST=SpdyNetworkTransactionTest.ServerPushDuplicate
Review URL: http://codereview.chromium.org/3310009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58458 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_session.cc')
-rw-r--r-- | net/spdy/spdy_session.cc | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index 23dcbbb..ba8755c 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -383,6 +383,7 @@ int SpdySession::CreateStream( return CreateStreamImpl(url, priority, spdy_stream, stream_net_log); } + net_log().AddEvent(NetLog::TYPE_SPDY_SESSION_STALLED_MAX_STREAMS, NULL); create_stream_queues_[priority].push( PendingCreateStream(url, priority, spdy_stream, stream_net_log, callback)); @@ -1050,6 +1051,15 @@ void SpdySession::OnSyn(const spdy::SpdySynStreamControlFrame& frame, const linked_ptr<spdy::SpdyHeaderBlock>& headers) { spdy::SpdyStreamId stream_id = frame.stream_id(); spdy::SpdyStreamId associated_stream_id = frame.associated_stream_id(); + + if (net_log_.IsLoggingAll()) { + net_log_.AddEvent( + NetLog::TYPE_SPDY_SESSION_PUSHED_SYN_STREAM, + new NetLogSpdySynParameter( + headers, static_cast<spdy::SpdyControlFlags>(frame.flags()), + stream_id)); + } + // Server-initiated streams should have even sequence numbers. if ((stream_id & 0x1) != 0) { LOG(ERROR) << "Received invalid OnSyn stream id " << stream_id; @@ -1090,28 +1100,21 @@ void SpdySession::OnSyn(const spdy::SpdySynStreamControlFrame& frame, return; } - scoped_refptr<SpdyStream> stream; - - stream = new SpdyStream(this, stream_id, true, net_log_); - - if (net_log_.IsLoggingAll()) { - net_log_.AddEvent( - NetLog::TYPE_SPDY_SESSION_PUSHED_SYN_STREAM, - new NetLogSpdySynParameter( - headers, static_cast<spdy::SpdyControlFlags>(frame.flags()), - stream_id)); - } - // TODO(erikchen): Actually do something with the associated id. - stream->set_path(path); - // There should not be an existing pushed stream with the same path. PushedStreamMap::iterator it = unclaimed_pushed_streams_.find(path); if (it != unclaimed_pushed_streams_.end()) { LOG(ERROR) << "Received duplicate pushed stream with path: " << path; ResetStream(stream_id, spdy::PROTOCOL_ERROR); + return; } + + scoped_refptr<SpdyStream> stream = + new SpdyStream(this, stream_id, true, net_log_); + + stream->set_path(path); + unclaimed_pushed_streams_[path] = stream; ActivateStream(stream); |