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

Unified Diff: net/spdy/spdy_session.cc

Issue 959743002: Account for HTTP/2 padding in receive windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit. Created 5 years, 10 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
Index: net/spdy/spdy_session.cc
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index dcdc92813b88fc78215aac9b309f6be1df6479a5..1d73e1524540f5b7cd22fbe49960a99c14cadcc5 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -2055,9 +2055,20 @@ void SpdySession::OnStreamFrameData(SpdyStreamId stream_id,
CHECK(in_io_loop_);
if (data == NULL && len != 0) {
- // This is notification of consumed data padding.
- // TODO(jgraettinger): Properly flow padding into WINDOW_UPDATE frames.
- // See crbug.com/353012.
+ if (flow_control_state_ != FLOW_CONTROL_STREAM_AND_SESSION)
+ return;
+
+ // Decrease window size because padding bytes are received.
+ // Increase window size because padding bytes are consumed (by discarding).
+ // Net result: |session_unacked_recv_window_bytes_| increases by |len|,
+ // |session_recv_window_size_| does not change.
+ DecreaseRecvWindowSize(static_cast<int32>(len));
+ IncreaseRecvWindowSize(static_cast<int32>(len));
+
+ ActiveStreamMap::iterator it = active_streams_.find(stream_id);
+ if (it == active_streams_.end())
+ return;
+ it->second.stream->OnPaddingConsumed(len);
return;
}

Powered by Google App Engine
This is Rietveld 408576698