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

Side by Side Diff: net/quic/quic_session_test.cc

Issue 555143002: Fix bug where QUIC_VERSION_21 would stall after sending too many headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_session.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_session.h" 5 #include "net/quic/quic_session.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 session_.OnSuccessfulVersionNegotiation(QUIC_VERSION_18); 898 session_.OnSuccessfulVersionNegotiation(QUIC_VERSION_18);
899 EXPECT_FALSE(session_.flow_controller()->IsEnabled()); 899 EXPECT_FALSE(session_.flow_controller()->IsEnabled());
900 EXPECT_TRUE(stream->flow_controller()->IsEnabled()); 900 EXPECT_TRUE(stream->flow_controller()->IsEnabled());
901 901
902 // Version 16 means all flow control is disabled. 902 // Version 16 means all flow control is disabled.
903 session_.OnSuccessfulVersionNegotiation(QUIC_VERSION_16); 903 session_.OnSuccessfulVersionNegotiation(QUIC_VERSION_16);
904 EXPECT_FALSE(session_.flow_controller()->IsEnabled()); 904 EXPECT_FALSE(session_.flow_controller()->IsEnabled());
905 EXPECT_FALSE(stream->flow_controller()->IsEnabled()); 905 EXPECT_FALSE(stream->flow_controller()->IsEnabled());
906 } 906 }
907 907
908 TEST_P(QuicSessionTest, WindowUpdateUnblocksHeadersStream) {
909 // Test that a flow control blocked headers stream gets unblocked on recipt of
910 // a WINDOW_UPDATE frame. Regression test for b/17413860.
911 if (version() < QUIC_VERSION_21) {
912 return;
913 }
914
915 // Set the headers stream to be flow control blocked.
916 QuicHeadersStream* headers_stream =
917 QuicSessionPeer::GetHeadersStream(&session_);
918 QuicFlowControllerPeer::SetSendWindowOffset(headers_stream->flow_controller(),
919 0);
920 EXPECT_TRUE(headers_stream->flow_controller()->IsBlocked());
921
922 // Unblock the headers stream by supplying a WINDOW_UPDATE.
923 QuicWindowUpdateFrame window_update_frame(headers_stream->id(),
924 2 * kDefaultFlowControlSendWindow);
925 vector<QuicWindowUpdateFrame> frames;
926 frames.push_back(window_update_frame);
927 session_.OnWindowUpdateFrames(frames);
928 EXPECT_FALSE(headers_stream->flow_controller()->IsBlocked());
929 }
930
908 TEST_P(QuicSessionTest, TooManyUnfinishedStreamsCauseConnectionClose) { 931 TEST_P(QuicSessionTest, TooManyUnfinishedStreamsCauseConnectionClose) {
909 if (version() < QUIC_VERSION_18) { 932 if (version() < QUIC_VERSION_18) {
910 return; 933 return;
911 } 934 }
912 // If a buggy/malicious peer creates too many streams that are not ended with 935 // If a buggy/malicious peer creates too many streams that are not ended with
913 // a FIN or RST then we send a connection close. 936 // a FIN or RST then we send a connection close.
914 ValueRestore<bool> old_flag(&FLAGS_close_quic_connection_unfinished_streams, 937 ValueRestore<bool> old_flag(&FLAGS_close_quic_connection_unfinished_streams,
915 true); 938 true);
916 939
917 EXPECT_CALL(*connection_, 940 EXPECT_CALL(*connection_,
(...skipping 12 matching lines...) Expand all
930 frames.push_back(data1); 953 frames.push_back(data1);
931 session_.OnStreamFrames(frames); 954 session_.OnStreamFrames(frames);
932 EXPECT_EQ(1u, session_.GetNumOpenStreams()); 955 EXPECT_EQ(1u, session_.GetNumOpenStreams());
933 session_.CloseStream(i); 956 session_.CloseStream(i);
934 } 957 }
935 } 958 }
936 959
937 } // namespace 960 } // namespace
938 } // namespace test 961 } // namespace test
939 } // namespace net 962 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_session.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698