From 32ef2c3cb2f0f13c6b46222d98c3316a69d7b411 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Sun, 17 Mar 2024 21:48:18 +0100 Subject: [PATCH] fix(bin): enable pacing on client & server by default (#1753) * fix(bin): enable pacing on server by default Before https://github.com/mozilla/neqo/pull/1724 `neqo-server` would always run with `ConnectionParameters::pacing` `true`. `neqo-client` would provide a command line flag `--pacing` which defaulted to `false`. https://github.com/mozilla/neqo/pull/1724 consolidated the `QuicParameters` `struct` from `neqo-client` and `neqo-server`. Since both `neqo-client` and `neqo-server` default to `pacing` `false`. This commit restores the pre-#1724 behavior, i.e. `neqo-server` defaulting to `pacing=true` and `neqo-client` defaulting to `pacing=false`. (Note that you will have to provide a value to `--pacing` from now on. I.e. `--pacing=true` or `--pacing=false` instead of just `--pacing`.) * fix(bin): enable pacing by default and add optional --no-pacing Before https://github.com/mozilla/neqo/pull/1724 `neqo-server` would always run with `ConnectionParameters::pacing` `true`. `neqo-client` would provide a command line flag `--pacing` which defaulted to `false`. https://github.com/mozilla/neqo/pull/1724 consolidated the `QuicParameters` `struct` from `neqo-client` and `neqo-server`. Since both `neqo-client` and `neqo-server` default to `pacing` `false`. This commit replaces the `--pacing` flag with `--no-pacing`. Pacing is enabled by default on both `neqo-server` and `neqo-client`. * Update test/upload_test.sh * Update comment --- neqo-bin/src/lib.rs | 8 ++++---- test/upload_test.sh | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/neqo-bin/src/lib.rs b/neqo-bin/src/lib.rs index 8a7ff69b69..b7bc158245 100644 --- a/neqo-bin/src/lib.rs +++ b/neqo-bin/src/lib.rs @@ -89,9 +89,9 @@ pub struct QuicParameters { /// The congestion controller to use. pub congestion_control: CongestionControlAlgorithm, - #[arg(long = "pacing")] - /// Whether pacing is enabled. - pub pacing: bool, + #[arg(long = "no-pacing")] + /// Whether to disable pacing. + pub no_pacing: bool, #[arg(name = "preferred-address-v4", long)] /// An IPv4 address for the server preferred address. @@ -162,7 +162,7 @@ impl QuicParameters { .max_streams(StreamType::UniDi, self.max_streams_uni) .idle_timeout(Duration::from_secs(self.idle_timeout)) .cc_algorithm(self.congestion_control) - .pacing(self.pacing); + .pacing(!self.no_pacing); if let Some(&first) = self.quic_version.first() { let all = if self.quic_version[1..].contains(&first) { diff --git a/test/upload_test.sh b/test/upload_test.sh index 40c3aaaeb9..685a6a926c 100755 --- a/test/upload_test.sh +++ b/test/upload_test.sh @@ -9,9 +9,10 @@ cc=cubic client="cargo run --release --bin neqo-client -- http://$server_address:$server_port/ --test upload --upload-size $upload_size --cc $cc" server="cargo run --release --bin neqo-server -- --db ../test-fixture/db $server_address:$server_port" server_pid=0 -pacing=true -if [ "$pacing" = true ]; then - client="$client --pacing" +no_pacing=false +if [ "$no_pacing" = true ]; then + client="$client --no-pacing" + server="$server --no-pacing" fi # Define two indexed arrays to store network conditions