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

Unified Diff: net/quic/quic_session.cc

Issue 2104633002: Landing recent QUIC changes until 6/24/2016 14:00 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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_server_session_base_test.cc ('k') | net/quic/quic_spdy_stream.h » ('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 609f353688097db5443fd08e45a90832b62181b7..b232a1e71f6e4a49ed9549e390242559bea7aed9 100644
--- a/net/quic/quic_session.cc
+++ b/net/quic/quic_session.cc
@@ -31,8 +31,8 @@ namespace net {
QuicSession::QuicSession(QuicConnection* connection, const QuicConfig& config)
: connection_(connection),
config_(config),
- max_open_outgoing_streams_(config_.MaxStreamsPerConnection()),
- max_open_incoming_streams_(config_.MaxStreamsPerConnection()),
+ max_open_outgoing_streams_(kDefaultMaxStreamsPerConnection),
+ max_open_incoming_streams_(config_.GetMaxIncomingDynamicStreamsToSend()),
next_outgoing_stream_id_(perspective() == Perspective::IS_SERVER ? 2 : 3),
largest_peer_created_stream_id_(
perspective() == Perspective::IS_SERVER ? 1 : 0),
@@ -391,7 +391,15 @@ bool QuicSession::IsCryptoHandshakeConfirmed() {
void QuicSession::OnConfigNegotiated() {
connection_->SetFromConfig(config_);
- uint32_t max_streams = config_.MaxStreamsPerConnection();
+ const QuicVersion version = connection()->version();
+ uint32_t max_streams = 0;
+ if (version > QUIC_VERSION_34 &&
+ config_.HasReceivedMaxIncomingDynamicStreams()) {
+ max_streams = config_.ReceivedMaxIncomingDynamicStreams();
+ } else {
+ max_streams = config_.MaxStreamsPerConnection();
+ }
+ set_max_open_outgoing_streams(max_streams);
if (!FLAGS_quic_enable_autotune_by_default &&
perspective() == Perspective::IS_SERVER) {
if (config_.HasReceivedConnectionOptions()) {
@@ -412,17 +420,25 @@ void QuicSession::OnConfigNegotiated() {
}
}
- set_max_open_outgoing_streams(max_streams);
-
- // A small number of additional incoming streams beyond the limit should be
- // allowed. 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.
- uint32_t max_incoming_streams =
- max(max_streams + kMaxStreamsMinimumIncrement,
- static_cast<uint32_t>(max_streams * kMaxStreamsMultiplier));
- set_max_open_incoming_streams(max_incoming_streams);
+ if (version <= QUIC_VERSION_34) {
+ // A small number of additional incoming streams beyond the limit should be
+ // allowed. 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.
+ uint32_t max_incoming_streams =
+ max(max_streams + kMaxStreamsMinimumIncrement,
+ static_cast<uint32_t>(max_streams * kMaxStreamsMultiplier));
+ set_max_open_incoming_streams(max_incoming_streams);
+ } else {
+ uint32_t max_incoming_streams_to_send =
+ config_.GetMaxIncomingDynamicStreamsToSend();
+ uint32_t max_incoming_streams =
+ max(max_incoming_streams_to_send + kMaxStreamsMinimumIncrement,
+ static_cast<uint32_t>(max_incoming_streams_to_send *
+ kMaxStreamsMultiplier));
+ set_max_open_incoming_streams(max_incoming_streams);
+ }
if (config_.HasReceivedInitialStreamFlowControlWindowBytes()) {
// Streams which were created before the SHLO was received (0-RTT
« no previous file with comments | « net/quic/quic_server_session_base_test.cc ('k') | net/quic/quic_spdy_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698