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

Unified Diff: net/spdy/spdy_stream.cc

Issue 1051213006: Fix flow control enforcement condition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/packet/data frame/g Created 5 years, 8 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_session_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_stream.cc
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc
index 31bc0aed2b8673b47ff065dfb9c2d3c561a9da4e..9f8c02a98b7807c0213d2a15227197674b28fe5a 100644
--- a/net/spdy/spdy_stream.cc
+++ b/net/spdy/spdy_stream.cc
@@ -347,12 +347,12 @@ void SpdyStream::DecreaseRecvWindowSize(int32 delta_window_size) {
DCHECK_GE(session_->flow_control_state(), SpdySession::FLOW_CONTROL_STREAM);
DCHECK_GE(delta_window_size, 1);
- // Since we never decrease the initial receive window size,
- // |delta_window_size| should never cause |recv_window_size_| to go
- // negative. If we do, the receive window isn't being respected.
- if (delta_window_size > recv_window_size_) {
+ // The receiving window size as the peer knows it is
+ // |recv_window_size_ - unacked_recv_window_bytes_|, if more data are sent by
+ // the peer, that means that the receive window is not being respected.
+ if (delta_window_size > recv_window_size_ - unacked_recv_window_bytes_) {
session_->ResetStream(
- stream_id_, RST_STREAM_PROTOCOL_ERROR,
+ stream_id_, RST_STREAM_FLOW_CONTROL_ERROR,
"delta_window_size is " + base::IntToString(delta_window_size) +
" in DecreaseRecvWindowSize, which is larger than the receive " +
"window size of " + base::IntToString(recv_window_size_));
« no previous file with comments | « net/spdy/spdy_session_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698