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

Unified Diff: net/quic/quic_config.cc

Issue 2101353003: Add a new kMIDS (Max Incoming Dynamic Streams) config option, to eventually replace kMSPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final
Patch Set: 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_config.h ('k') | net/quic/quic_config_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_config.cc
diff --git a/net/quic/quic_config.cc b/net/quic/quic_config.cc
index 7fd0c41b9f218620110a7cabe1e9815af01c4492..25e567cb0a417d7ae7329b0d95d0bd33ca93ae7f 100644
--- a/net/quic/quic_config.cc
+++ b/net/quic/quic_config.cc
@@ -408,7 +408,8 @@ QuicConfig::QuicConfig()
connection_options_(kCOPT, PRESENCE_OPTIONAL),
idle_connection_state_lifetime_seconds_(kICSL, PRESENCE_REQUIRED),
silent_close_(kSCLS, PRESENCE_OPTIONAL),
- max_streams_per_connection_(kMSPC, PRESENCE_REQUIRED),
+ max_streams_per_connection_(kMSPC, PRESENCE_OPTIONAL),
+ max_incoming_dynamic_streams_(kMIDS, PRESENCE_OPTIONAL),
bytes_for_connection_id_(kTCID, PRESENCE_OPTIONAL),
initial_round_trip_time_us_(kIRTT, PRESENCE_OPTIONAL),
initial_stream_flow_control_window_bytes_(kSFCW, PRESENCE_OPTIONAL),
@@ -501,6 +502,23 @@ uint32_t QuicConfig::MaxStreamsPerConnection() const {
return max_streams_per_connection_.GetUint32();
}
+void QuicConfig::SetMaxIncomingDynamicStreamsToSend(
+ uint32_t max_incoming_dynamic_streams) {
+ max_incoming_dynamic_streams_.SetSendValue(max_incoming_dynamic_streams);
+}
+
+uint32_t QuicConfig::GetMaxIncomingDynamicStreamsToSend() {
+ return max_incoming_dynamic_streams_.GetSendValue();
+}
+
+bool QuicConfig::HasReceivedMaxIncomingDynamicStreams() {
+ return max_incoming_dynamic_streams_.HasReceivedValue();
+}
+
+uint32_t QuicConfig::ReceivedMaxIncomingDynamicStreams() {
+ return max_incoming_dynamic_streams_.GetReceivedValue();
+}
+
bool QuicConfig::HasSetBytesForConnectionIdToSend() const {
return bytes_for_connection_id_.HasSendValue();
}
@@ -639,6 +657,7 @@ void QuicConfig::SetDefaults() {
silent_close_.set(1, 0);
SetMaxStreamsPerConnection(kDefaultMaxStreamsPerConnection,
kDefaultMaxStreamsPerConnection);
+ SetMaxIncomingDynamicStreamsToSend(kDefaultMaxStreamsPerConnection);
max_time_before_crypto_handshake_ =
QuicTime::Delta::FromSeconds(kMaxTimeForCryptoHandshakeSecs);
max_idle_time_before_crypto_handshake_ =
@@ -653,6 +672,7 @@ void QuicConfig::ToHandshakeMessage(CryptoHandshakeMessage* out) const {
idle_connection_state_lifetime_seconds_.ToHandshakeMessage(out);
silent_close_.ToHandshakeMessage(out);
max_streams_per_connection_.ToHandshakeMessage(out);
+ max_incoming_dynamic_streams_.ToHandshakeMessage(out);
bytes_for_connection_id_.ToHandshakeMessage(out);
initial_round_trip_time_us_.ToHandshakeMessage(out);
initial_stream_flow_control_window_bytes_.ToHandshakeMessage(out);
@@ -683,6 +703,10 @@ QuicErrorCode QuicConfig::ProcessPeerHello(
error_details);
}
if (error == QUIC_NO_ERROR) {
+ error = max_incoming_dynamic_streams_.ProcessPeerHello(
+ peer_hello, hello_type, error_details);
+ }
+ if (error == QUIC_NO_ERROR) {
error = bytes_for_connection_id_.ProcessPeerHello(peer_hello, hello_type,
error_details);
}
« no previous file with comments | « net/quic/quic_config.h ('k') | net/quic/quic_config_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698