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

Unified Diff: net/quic/quic_session.cc

Issue 557363003: Allow number of open QUIC streams to grow 10% beyond configured limit at (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@change_initial_RTT_estimate_75389539
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_session.h ('k') | net/tools/quic/quic_server_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_session.cc
diff --git a/net/quic/quic_session.cc b/net/quic/quic_session.cc
index b31224392ad8d433d0a2c0f75b3bdcfafd298e6d..7fd5ae9c73217341e85c514be95b31e94174d03d 100644
--- a/net/quic/quic_session.cc
+++ b/net/quic/quic_session.cc
@@ -476,6 +476,15 @@ bool QuicSession::IsCryptoHandshakeConfirmed() {
void QuicSession::OnConfigNegotiated() {
connection_->SetFromConfig(config_);
QuicVersion version = connection()->version();
+
+ // A server should accept a small number of additional streams beyond the
+ // limit sent to the client. This helps avoid early connection termination
+ // when FIN/RSTs for old streams are lost or arrive out of order.
+ if (FLAGS_quic_allow_more_open_streams) {
+ set_max_open_streams((is_server() ? kMaxStreamsMultiplier : 1.0) *
+ config_.max_streams_per_connection());
+ }
+
if (version <= QUIC_VERSION_16) {
return;
}
@@ -564,7 +573,9 @@ void QuicSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) {
// the peer.
connection_->NeuterUnencryptedPackets();
connection_->SetOverallConnectionTimeout(QuicTime::Delta::Infinite());
- max_open_streams_ = config_.max_streams_per_connection();
+ if (!FLAGS_quic_allow_more_open_streams) {
+ max_open_streams_ = config_.max_streams_per_connection();
+ }
break;
default:
@@ -679,6 +690,11 @@ QuicDataStream* QuicSession::GetIncomingDataStream(QuicStreamId stream_id) {
return stream;
}
+void QuicSession::set_max_open_streams(size_t max_open_streams) {
+ DVLOG(1) << "Setting max_open_streams_ to " << max_open_streams;
+ max_open_streams_ = max_open_streams;
+}
+
bool QuicSession::IsClosedStream(QuicStreamId id) {
DCHECK_NE(0u, id);
if (id == kCryptoStreamId) {
« no previous file with comments | « net/quic/quic_session.h ('k') | net/tools/quic/quic_server_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698