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. |