Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: net/spdy/spdy_session.cc

Issue 2811072: SPDY sends RST_STREAM upon cancelling request, or bad header parse data. (Closed)
Patch Set: Merge trunk Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_network_transaction_unittest.cc ('k') | net/spdy/spdy_session_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session.cc
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 26b6a108b136f32026197e8e7d5a648499f31144..093ea93027482ea28d2fce1f3c3794d76fbe2959 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;
}
}
« no previous file with comments | « net/spdy/spdy_network_transaction_unittest.cc ('k') | net/spdy/spdy_session_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698