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

Unified Diff: net/spdy/spdy_session.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.h ('k') | net/spdy/spdy_session_unittest.cc » ('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 44858e97af9593f290858206be06e13514b33f30..7fabbef565941ddfb79c150a9b996bbef2aa303c 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -3204,10 +3204,12 @@ void SpdySession::DecreaseRecvWindowSize(int32 delta_window_size) {
DCHECK_EQ(flow_control_state_, FLOW_CONTROL_STREAM_AND_SESSION);
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 > session_recv_window_size_) {
+ // The receiving window size as the peer knows it is
+ // |session_recv_window_size_ - session_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 >
+ session_recv_window_size_ - session_unacked_recv_window_bytes_) {
RecordProtocolErrorHistogram(PROTOCOL_ERROR_RECEIVE_WINDOW_VIOLATION);
DoDrainSession(
ERR_SPDY_FLOW_CONTROL_ERROR,
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698