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

Unified Diff: net/quic/quic_session.cc

Issue 607763007: QUIC server max streams is now at least 10 streams larger than (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Rename_QuicConfig_methods_76185470
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_protocol.h ('k') | net/tools/quic/quic_server_session_test.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 77eaa52057ea2af35bc364a620d56ad955cefced..42c05b612a239786888cdb06469ba2d2e045ed60 100644
--- a/net/quic/quic_session.cc
+++ b/net/quic/quic_session.cc
@@ -16,6 +16,7 @@ using base::StringPiece;
using base::hash_map;
using base::hash_set;
using std::make_pair;
+using std::max;
using std::vector;
namespace net {
@@ -471,12 +472,19 @@ 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_.MaxStreamsPerConnection());
+ uint32 max_streams = config_.MaxStreamsPerConnection();
+ if (is_server()) {
+ // 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.
+ // Use a minimum number of additional streams, or a percentage increase,
+ // whichever is larger.
+ max_streams =
+ max(max_streams + kMaxStreamsMinimumIncrement,
+ static_cast<uint32>(max_streams * kMaxStreamsMultiplier));
+ }
+ set_max_open_streams(max_streams);
}
if (version <= QUIC_VERSION_16) {
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/tools/quic/quic_server_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698