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

Unified Diff: net/spdy/spdy_stream.cc

Issue 10836084: SPDY - Handle incomplete headers during server push. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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_stream.h ('k') | net/spdy/spdy_stream_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_stream.cc
===================================================================
--- net/spdy/spdy_stream.cc (revision 149736)
+++ net/spdy/spdy_stream.cc (working copy)
@@ -176,7 +176,11 @@
// We don't have complete headers. Assume we're waiting for another
// HEADERS frame. Since we don't have headers, we had better not have
// any pending data frames.
- DCHECK_EQ(0U, pending_buffers_.size());
+ if (pending_buffers_.size() != 0U) {
+ LogStreamError(ERR_SPDY_PROTOCOL_ERROR,
+ "HEADERS incomplete headers, but pending data frames.");
+ session_->CloseStream(stream_id_, ERR_SPDY_PROTOCOL_ERROR);
+ }
return;
}
@@ -490,7 +494,12 @@
return;
}
- delegate_->OnDataReceived(data, length);
+ if (delegate_->OnDataReceived(data, length) != net::OK) {
+ // |delegate_| rejected the data.
+ LogStreamError(ERR_SPDY_PROTOCOL_ERROR, "Delegate rejected the data");
+ session_->CloseStream(stream_id_, ERR_SPDY_PROTOCOL_ERROR);
+ return;
+ }
}
// This function is only called when an entire frame is written.
« no previous file with comments | « net/spdy/spdy_stream.h ('k') | net/spdy/spdy_stream_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698