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

Unified Diff: net/quic/core/quic_sent_packet_manager.cc

Issue 2537543005: Add QUIC client connection options. Only respected on the client side. No functional change. Prot… (Closed)
Patch Set: Rebase Created 4 years, 1 month 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/core/quic_flags_list.h ('k') | net/quic/core/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « net/quic/core/quic_flags_list.h ('k') | net/quic/core/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698