summaryrefslogtreecommitdiffstats
path: root/net/spdy/spdy_session.cc
diff options
context:
space:
mode:
authorerikchen@google.com <erikchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-26 21:46:37 +0000
committererikchen@google.com <erikchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-26 21:46:37 +0000
commita3eb05b90d69e44ada9e6afa99efb05e16c12996 (patch)
treec2d5e324f41bc5fb6f256ec5dbe238d46570f902 /net/spdy/spdy_session.cc
parent3b1cbd29ffbfde742e7cdda03460912c9c812c7b (diff)
downloadchromium_src-a3eb05b90d69e44ada9e6afa99efb05e16c12996.zip
chromium_src-a3eb05b90d69e44ada9e6afa99efb05e16c12996.tar.gz
chromium_src-a3eb05b90d69e44ada9e6afa99efb05e16c12996.tar.bz2
SPDY sends RST_STREAM upon cancelling request, or bad header parse data.
Also fix spdy_http_stream_test errors. TEST=net_unittests BUG=46589, 47478, 50198 Review URL: http://codereview.chromium.org/3014030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53693 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_session.cc')
-rw-r--r--net/spdy/spdy_session.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 26b6a10..093ea93 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -1122,8 +1122,16 @@ void SpdySession::OnControl(const spdy::SpdyControlFrame* frame) {
uint32 type = frame->type();
if (type == spdy::SYN_STREAM || type == spdy::SYN_REPLY) {
if (!spdy_framer_.ParseHeaderBlock(frame, headers.get())) {
- LOG(WARNING) << "Could not parse Spdy Control Frame Header";
- // TODO(mbelshe): Error the session?
+ LOG(WARNING) << "Could not parse Spdy Control Frame Header.";
+ int stream_id = 0;
+ if (type == spdy::SYN_STREAM)
+ stream_id = (reinterpret_cast<const spdy::SpdySynStreamControlFrame*>
+ (frame))->stream_id();
+ if (type == spdy::SYN_REPLY)
+ stream_id = (reinterpret_cast<const spdy::SpdySynReplyControlFrame*>
+ (frame))->stream_id();
+ if(IsStreamActive(stream_id))
+ ResetStream(stream_id, spdy::PROTOCOL_ERROR);
return;
}
}