From cdb4449e7c7bd03960d09429f5dfc53819066878 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Fri, 19 Jan 2024 14:29:29 +0100 Subject: [PATCH 1/2] feat(qns): implement v2 testcase Add support for Quic Network Simulator `v2` testcase. In `v2` testcase, don't restrict the server to `Version::Version1`, thus allowing the server to upgrade incoming `Version::Version1` connection to compatible `Version::Version2` connection. See also [Quic Network Simulator `v2` testcase implementation]( https://github.com/quic-interop/quic-interop-runner/blob/ca27dcb5272a82d994337ae3d14533c318d81b76/testcases.py#L1460-L1545). --- neqo-client/src/main.rs | 1 + neqo-server/src/main.rs | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/neqo-client/src/main.rs b/neqo-client/src/main.rs index 1ea52f8fb..81fe1d654 100644 --- a/neqo-client/src/main.rs +++ b/neqo-client/src/main.rs @@ -1018,6 +1018,7 @@ fn main() -> Res<()> { args.use_old_http = true; args.key_update = true; } + "v2" => {} _ => exit(127), } } diff --git a/neqo-server/src/main.rs b/neqo-server/src/main.rs index ca6b6800f..426e6dc96 100644 --- a/neqo-server/src/main.rs +++ b/neqo-server/src/main.rs @@ -837,10 +837,12 @@ fn main() -> Result<(), io::Error> { if let Some(testcase) = args.qns_test.as_ref() { if args.quic_parameters.quic_version.is_empty() { - // Quic Interop Runner expects the server to support `Version1` only. - // Exceptions are testcases `versionnegotiation` and `v2`. Neither are - // supported by Neqo. Thus always set `Version1`. - args.quic_parameters.quic_version = vec![VersionArg(Version::Version1)]; + // Quic Interop Runner expects the server to support `Version1` + // only. Exceptions are testcases `versionnegotiation` (not yet + // implemented) and `v2`. + if testcase != "v2" { + args.quic_parameters.quic_version = vec![VersionArg(Version::Version1)]; + } } else { qwarn!("Both -V and --qns-test were set. Ignoring testcase specific versions."); } @@ -868,6 +870,7 @@ fn main() -> Result<(), io::Error> { args.alpn = String::from(HQ_INTEROP); args.retry = true; } + "v2" => (), _ => exit(127), } } From 61ed61ebd66320ab40f245afc1fa36bbbebd8784 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Fri, 19 Jan 2024 15:46:48 +0100 Subject: [PATCH 2/2] Set use_old_http --- neqo-client/src/main.rs | 4 +++- neqo-server/src/main.rs | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/neqo-client/src/main.rs b/neqo-client/src/main.rs index 81fe1d654..ca7cd9eb2 100644 --- a/neqo-client/src/main.rs +++ b/neqo-client/src/main.rs @@ -1018,7 +1018,9 @@ fn main() -> Res<()> { args.use_old_http = true; args.key_update = true; } - "v2" => {} + "v2" => { + args.use_old_http = true; + } _ => exit(127), } } diff --git a/neqo-server/src/main.rs b/neqo-server/src/main.rs index 426e6dc96..a9e4d37e6 100644 --- a/neqo-server/src/main.rs +++ b/neqo-server/src/main.rs @@ -870,7 +870,10 @@ fn main() -> Result<(), io::Error> { args.alpn = String::from(HQ_INTEROP); args.retry = true; } - "v2" => (), + "v2" => { + args.use_old_http = true; + args.alpn = String::from(HQ_INTEROP); + } _ => exit(127), } }