Index: net/http/http_network_session.cc |
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc |
index a4c1913950f22ea0043739f92f5ffb317a66c5b3..b7993218f215447b3eb4d660bc8d6e635e0826c7 100644 |
--- a/net/http/http_network_session.cc |
+++ b/net/http/http_network_session.cc |
@@ -65,6 +65,11 @@ |
// that seems large enough to receive data at line rate for most connections, |
// and does not consume "too much" memory. |
const int32_t kQuicSocketReceiveBufferSize = 1024 * 1024; // 1MB |
+ |
+// Number of recent connections to consider for certain thresholds |
+// that trigger disabling QUIC. E.g. disable QUIC if PUBLIC_RESET was |
+// received post handshake for at least 2 of 20 recent connections. |
+const int32_t kQuicMaxRecentDisabledReasons = 20; |
HttpNetworkSession::Params::Params() |
: client_socket_factory(NULL), |
@@ -101,6 +106,8 @@ |
quic_enable_non_blocking_io(false), |
quic_disable_disk_cache(false), |
quic_prefer_aes(false), |
+ quic_max_number_of_lossy_connections(0), |
+ quic_packet_loss_threshold(1.0f), |
quic_socket_receive_buffer_size(kQuicSocketReceiveBufferSize), |
quic_delay_tcp_race(true), |
quic_max_server_configs_stored_in_properties(0u), |
@@ -110,6 +117,9 @@ |
enable_user_alternate_protocol_ports(false), |
quic_crypto_client_stream_factory( |
QuicCryptoClientStreamFactory::GetDefaultFactory()), |
+ quic_max_recent_disabled_reasons(kQuicMaxRecentDisabledReasons), |
+ quic_threshold_public_resets_post_handshake(0), |
+ quic_threshold_timeouts_streams_open(0), |
quic_close_sessions_on_ip_change(false), |
quic_idle_connection_timeout_seconds(kIdleConnectionTimeoutSeconds), |
quic_reduced_ping_timeout_seconds(kPingTimeoutSecs), |
@@ -169,6 +179,11 @@ |
params.quic_enable_non_blocking_io, |
params.quic_disable_disk_cache, |
params.quic_prefer_aes, |
+ params.quic_max_number_of_lossy_connections, |
+ params.quic_packet_loss_threshold, |
+ params.quic_max_recent_disabled_reasons, |
+ params.quic_threshold_public_resets_post_handshake, |
+ params.quic_threshold_timeouts_streams_open, |
params.quic_socket_receive_buffer_size, |
params.quic_delay_tcp_race, |
params.quic_max_server_configs_stored_in_properties, |
@@ -321,6 +336,9 @@ |
params_.quic_enable_connection_racing); |
dict->SetBoolean("disable_disk_cache", params_.quic_disable_disk_cache); |
dict->SetBoolean("prefer_aes", params_.quic_prefer_aes); |
+ dict->SetInteger("max_number_of_lossy_connections", |
+ params_.quic_max_number_of_lossy_connections); |
+ dict->SetDouble("packet_loss_threshold", params_.quic_packet_loss_threshold); |
dict->SetBoolean("delay_tcp_race", params_.quic_delay_tcp_race); |
dict->SetInteger("max_server_configs_stored_in_properties", |
params_.quic_max_server_configs_stored_in_properties); |
@@ -335,7 +353,8 @@ |
params_.quic_disable_preconnect_if_0rtt); |
dict->SetBoolean("disable_quic_on_timeout_with_open_streams", |
params_.disable_quic_on_timeout_with_open_streams); |
- dict->SetBoolean("is_quic_disabled", quic_stream_factory_.IsQuicDisabled()); |
+ dict->SetString("disabled_reason", |
+ quic_stream_factory_.QuicDisabledReasonString()); |
dict->SetBoolean("force_hol_blocking", params_.quic_force_hol_blocking); |
dict->SetBoolean("race_cert_verification", |
params_.quic_race_cert_verification); |