| Index: net/quic/core/quic_sent_packet_manager.cc
|
| diff --git a/net/quic/core/quic_sent_packet_manager.cc b/net/quic/core/quic_sent_packet_manager.cc
|
| index b71fe7239a89ecca4eac65870c8865e8d235ab4b..1732f4a98f776c9b294a93c4547977ed0fdab278 100644
|
| --- a/net/quic/core/quic_sent_packet_manager.cc
|
| +++ b/net/quic/core/quic_sent_packet_manager.cc
|
| @@ -111,23 +111,47 @@ void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) {
|
| min(kMaxInitialRoundTripTimeUs,
|
| config.GetInitialRoundTripTimeUsToSend())));
|
| }
|
| - if (FLAGS_quic_allow_new_bbr && config.HasReceivedConnectionOptions() &&
|
| - ContainsQuicTag(config.ReceivedConnectionOptions(), kTBBR)) {
|
| - SetSendAlgorithm(kBBR);
|
| - }
|
| - if (config.HasReceivedConnectionOptions() &&
|
| - ContainsQuicTag(config.ReceivedConnectionOptions(), kRENO)) {
|
| - if (ContainsQuicTag(config.ReceivedConnectionOptions(), kBYTE)) {
|
| - SetSendAlgorithm(kRenoBytes);
|
| - } else {
|
| - SetSendAlgorithm(kReno);
|
| + // Configure congestion control.
|
| + const bool enable_client_connection_options =
|
| + FLAGS_quic_client_connection_options;
|
| + if (enable_client_connection_options) {
|
| + if (FLAGS_quic_allow_new_bbr &&
|
| + config.HasClientRequestedIndependentOption(kTBBR, perspective_)) {
|
| + SetSendAlgorithm(kBBR);
|
| }
|
| - } else if (config.HasReceivedConnectionOptions() &&
|
| - ContainsQuicTag(config.ReceivedConnectionOptions(), kBYTE)) {
|
| - if (FLAGS_quic_default_enable_cubic_bytes) {
|
| - SetSendAlgorithm(kCubic);
|
| - } else {
|
| - SetSendAlgorithm(kCubicBytes);
|
| + if (config.HasClientRequestedIndependentOption(kRENO, perspective_)) {
|
| + if (config.HasClientRequestedIndependentOption(kBYTE, perspective_)) {
|
| + SetSendAlgorithm(kRenoBytes);
|
| + } else {
|
| + SetSendAlgorithm(kReno);
|
| + }
|
| + } else if (config.HasClientRequestedIndependentOption(kBYTE,
|
| + perspective_)) {
|
| + if (FLAGS_quic_default_enable_cubic_bytes) {
|
| + SetSendAlgorithm(kCubic);
|
| + } else {
|
| + SetSendAlgorithm(kCubicBytes);
|
| + }
|
| + }
|
| + } else {
|
| + if (FLAGS_quic_allow_new_bbr && config.HasReceivedConnectionOptions() &&
|
| + ContainsQuicTag(config.ReceivedConnectionOptions(), kTBBR)) {
|
| + SetSendAlgorithm(kBBR);
|
| + }
|
| + if (config.HasReceivedConnectionOptions() &&
|
| + ContainsQuicTag(config.ReceivedConnectionOptions(), kRENO)) {
|
| + if (ContainsQuicTag(config.ReceivedConnectionOptions(), kBYTE)) {
|
| + SetSendAlgorithm(kRenoBytes);
|
| + } else {
|
| + SetSendAlgorithm(kReno);
|
| + }
|
| + } else if (config.HasReceivedConnectionOptions() &&
|
| + ContainsQuicTag(config.ReceivedConnectionOptions(), kBYTE)) {
|
| + if (FLAGS_quic_default_enable_cubic_bytes) {
|
| + SetSendAlgorithm(kCubic);
|
| + } else {
|
| + SetSendAlgorithm(kCubicBytes);
|
| + }
|
| }
|
| }
|
| using_pacing_ = !FLAGS_quic_disable_pacing_for_perf_tests;
|
| @@ -147,17 +171,31 @@ void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) {
|
| if (config.HasClientSentConnectionOption(kNRTO, perspective_)) {
|
| use_new_rto_ = true;
|
| }
|
| - if (config.HasReceivedConnectionOptions() &&
|
| - ContainsQuicTag(config.ReceivedConnectionOptions(), kTIME)) {
|
| - general_loss_algorithm_.SetLossDetectionType(kTime);
|
| - }
|
| - if (config.HasReceivedConnectionOptions() &&
|
| - ContainsQuicTag(config.ReceivedConnectionOptions(), kATIM)) {
|
| - general_loss_algorithm_.SetLossDetectionType(kAdaptiveTime);
|
| - }
|
| - if (FLAGS_quic_enable_lazy_fack && config.HasReceivedConnectionOptions() &&
|
| - ContainsQuicTag(config.ReceivedConnectionOptions(), kLFAK)) {
|
| - general_loss_algorithm_.SetLossDetectionType(kLazyFack);
|
| + // Configure loss detection.
|
| + if (enable_client_connection_options) {
|
| + if (config.HasClientRequestedIndependentOption(kTIME, perspective_)) {
|
| + general_loss_algorithm_.SetLossDetectionType(kTime);
|
| + }
|
| + if (config.HasClientRequestedIndependentOption(kATIM, perspective_)) {
|
| + general_loss_algorithm_.SetLossDetectionType(kAdaptiveTime);
|
| + }
|
| + if (FLAGS_quic_enable_lazy_fack &&
|
| + config.HasClientRequestedIndependentOption(kLFAK, perspective_)) {
|
| + general_loss_algorithm_.SetLossDetectionType(kLazyFack);
|
| + }
|
| + } else {
|
| + if (config.HasReceivedConnectionOptions() &&
|
| + ContainsQuicTag(config.ReceivedConnectionOptions(), kTIME)) {
|
| + general_loss_algorithm_.SetLossDetectionType(kTime);
|
| + }
|
| + if (config.HasReceivedConnectionOptions() &&
|
| + ContainsQuicTag(config.ReceivedConnectionOptions(), kATIM)) {
|
| + general_loss_algorithm_.SetLossDetectionType(kAdaptiveTime);
|
| + }
|
| + if (FLAGS_quic_enable_lazy_fack && config.HasReceivedConnectionOptions() &&
|
| + ContainsQuicTag(config.ReceivedConnectionOptions(), kLFAK)) {
|
| + general_loss_algorithm_.SetLossDetectionType(kLazyFack);
|
| + }
|
| }
|
| if (config.HasClientSentConnectionOption(kUNDO, perspective_)) {
|
| undo_pending_retransmits_ = true;
|
|
|