summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorrjshade <rjshade@chromium.org>2014-09-09 13:00:57 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-09 20:06:33 +0000
commit87305fa7c4d95e4cdbe4eb11c0f947973ff57a05 (patch)
tree4c88cc5848804163bc4af9c91cafd2a72c9eff8e /net
parent68fb0260dc737199d920313b46b14a3b27835dcc (diff)
downloadchromium_src-87305fa7c4d95e4cdbe4eb11c0f947973ff57a05.zip
chromium_src-87305fa7c4d95e4cdbe4eb11c0f947973ff57a05.tar.gz
chromium_src-87305fa7c4d95e4cdbe4eb11c0f947973ff57a05.tar.bz2
Fix bug where QUIC_VERSION_21 would stall after sending too many headers.
Merge of internal change 74954339 BUG=412306 Review URL: https://codereview.chromium.org/555143002 Cr-Commit-Position: refs/heads/master@{#293994}
Diffstat (limited to 'net')
-rw-r--r--net/quic/quic_session.cc2
-rw-r--r--net/quic/quic_session_test.cc23
2 files changed, 24 insertions, 1 deletions
diff --git a/net/quic/quic_session.cc b/net/quic/quic_session.cc
index 91d8e55..d264cc1 100644
--- a/net/quic/quic_session.cc
+++ b/net/quic/quic_session.cc
@@ -272,7 +272,7 @@ void QuicSession::OnWindowUpdateFrames(
continue;
}
- if (connection_->version() <= QUIC_VERSION_21 &&
+ if (connection_->version() < QUIC_VERSION_21 &&
(stream_id == kCryptoStreamId || stream_id == kHeadersStreamId)) {
DLOG(DFATAL) << "WindowUpdate for stream " << stream_id << " in version "
<< QuicVersionToString(connection_->version());
diff --git a/net/quic/quic_session_test.cc b/net/quic/quic_session_test.cc
index 787f624..a29192e 100644
--- a/net/quic/quic_session_test.cc
+++ b/net/quic/quic_session_test.cc
@@ -905,6 +905,29 @@ TEST_P(QuicSessionTest, VersionNegotiationDisablesFlowControl) {
EXPECT_FALSE(stream->flow_controller()->IsEnabled());
}
+TEST_P(QuicSessionTest, WindowUpdateUnblocksHeadersStream) {
+ // Test that a flow control blocked headers stream gets unblocked on recipt of
+ // a WINDOW_UPDATE frame. Regression test for b/17413860.
+ if (version() < QUIC_VERSION_21) {
+ return;
+ }
+
+ // Set the headers stream to be flow control blocked.
+ QuicHeadersStream* headers_stream =
+ QuicSessionPeer::GetHeadersStream(&session_);
+ QuicFlowControllerPeer::SetSendWindowOffset(headers_stream->flow_controller(),
+ 0);
+ EXPECT_TRUE(headers_stream->flow_controller()->IsBlocked());
+
+ // Unblock the headers stream by supplying a WINDOW_UPDATE.
+ QuicWindowUpdateFrame window_update_frame(headers_stream->id(),
+ 2 * kDefaultFlowControlSendWindow);
+ vector<QuicWindowUpdateFrame> frames;
+ frames.push_back(window_update_frame);
+ session_.OnWindowUpdateFrames(frames);
+ EXPECT_FALSE(headers_stream->flow_controller()->IsBlocked());
+}
+
TEST_P(QuicSessionTest, TooManyUnfinishedStreamsCauseConnectionClose) {
if (version() < QUIC_VERSION_18) {
return;