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

Unified Diff: net/quic/quic_sent_packet_manager.cc

Issue 682293004: Change the number of emulated connections in QUIC's congestion control (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@merge_78853598
Patch Set: Created 6 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/quic_sent_packet_manager.h ('k') | net/quic/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/quic_sent_packet_manager.cc
diff --git a/net/quic/quic_sent_packet_manager.cc b/net/quic/quic_sent_packet_manager.cc
index 553e7e2f69a188ed7a7c2bb78c34323ab5741cf7..a6749ec65ba48e1f97d072ece29e50575c32b437 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -78,6 +78,7 @@ QuicSentPacketManager::QuicSentPacketManager(
congestion_control_type,
stats)),
loss_algorithm_(LossDetectionInterface::Create(loss_type)),
+ n_connection_simulation_(false),
receive_buffer_bytes_(kDefaultSocketReceiveBuffer),
least_packet_awaited_by_peer_(1),
first_rto_transmission_(0),
@@ -125,6 +126,9 @@ void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) {
if (HasClientSentConnectionOption(config, k1CON)) {
send_algorithm_->SetNumEmulatedConnections(1);
}
+ if (HasClientSentConnectionOption(config, kNCON)) {
+ n_connection_simulation_ = true;
+ }
if (HasClientSentConnectionOption(config, kNTLP)) {
max_tail_loss_probes_ = 0;
}
@@ -144,6 +148,14 @@ void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) {
}
}
+void QuicSentPacketManager::SetNumOpenStreams(size_t num_streams) {
+ if (n_connection_simulation_) {
+ // Ensure the number of connections is between 1 and 5.
+ send_algorithm_->SetNumEmulatedConnections(
+ min<size_t>(5, max<size_t>(1, num_streams)));
+ }
+}
+
bool QuicSentPacketManager::HasClientSentConnectionOption(
const QuicConfig& config, QuicTag tag) const {
if (is_server_) {
« no previous file with comments | « net/quic/quic_sent_packet_manager.h ('k') | net/quic/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698