Skip to content

Commit 2567dd9

Browse files
sfionovclaude
andauthored
Restore quic_version and wire it into Http3Settings (PR 49)
* Restore quic_version and wire it into Http3Settings The quiche -> NLC/http3 migration (AG-53338) dropped the quic_version fields because NLC's Http3Client did not expose the setting at the time. NLC's Http3Settings now has a quic_version field, so restore the removed struct fields and thread the value end-to-end into the QUIC version offered by ngtcp2. Direct-connect path (http3_upstream): read PROTOCOL_CONFIG->http3 and set m_h3_settings.quic_version before Http3Client::connect(). Ping/handoff path: VpnHttp3UpstreamConfig.quic_version flows through LocationsPingerInfo -> LocationsPinger -> PingInfo -> Ping -> QuicConnectorConnectParameters -> Http3Settings. The vpn_fsm locations-pinger initializer passes quic_version = 0 for now (to be wired from vpn_manager make_client_config later). Zero already selects the default version (NGTCP2_PROTO_VER_V1) in NLC, so the old QUICHE_PROTOCOL_VERSION fallbacks are gone. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Temporarily pin native_libs_common to snapshot 8.1.38-3-g3e5d3f1 Override to a git-described NCL snapshot that carries the changes this branch depends on, until a tagged NCL release is available. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Use dns-libs 2.8.58-2-g2c375f1c and native_libs_common 8.1.39 Bump dns-libs to 2.8.58-2-g2c375f1c and move native_libs_common off the temporary 8.1.38-3-g3e5d3f1 snapshot pin to the tagged 8.1.39 release, dropping the override now that a real release carries the needed changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Fix conan_bootstrap_deps.py * Add changelog entry for quic_version restore; document one-entry rule Add a single [Unreleased] entry for restoring the quic_version parameter, and add a Mandatory Task Rule that a required CHANGELOG.md update must contain exactly one entry per PR/change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1900391 commit 2567dd9

12 files changed

Lines changed: 66 additions & 7 deletions

AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ You MUST follow the following rules for EVERY task that you perform:
197197

198198
- You MUST update the unit tests for changed code.
199199

200+
- When a change is user-visible, you MUST update `CHANGELOG.md` under
201+
`## [Unreleased]` in the appropriate category. A required `CHANGELOG.md`
202+
update MUST contain exactly ONE entry for the PR/change: summarize the whole
203+
change in a single bullet, not one bullet per file or sub-change.
204+
200205
- You MUST run tests with the `make test` script to verify that your changes do
201206
not break existing functionality.
202207

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
1616

1717
### Fixed
1818

19+
- Restore the `quic_version` HTTP/3 upstream configuration parameter that was
20+
accidentally dropped during the quiche → ngtcp2 migration, wiring it through
21+
to the QUIC version offered by ngtcp2 (`0` selects the default version).
22+
1923
### Security
2024

2125
## [1.1.5-beta.6] - 2026-07-03

conanfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class VpnLibsConan(ConanFile):
3232
exports_sources = patch_files
3333

3434
def requirements(self):
35-
self.requires("dns-libs/2.8.58@adguard/oss", transitive_headers=True)
36-
self.requires("native_libs_common/8.1.38@adguard/oss", transitive_headers=True)
35+
self.requires("dns-libs/2.8.58-2-g2c375f1c@adguard/oss", transitive_headers=True)
36+
self.requires("native_libs_common/8.1.39@adguard/oss", transitive_headers=True)
3737

3838
self.requires("brotli/1.1.0", transitive_headers=True)
3939
self.requires("cxxopts/3.1.1", transitive_headers=True)

core/src/http3_upstream.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,13 @@ bool Http3Upstream::open_session(std::optional<Millis>) {
8787
}
8888

8989
const vpn_client::EndpointConnectionConfig &upstream_config = this->vpn->upstream_config;
90+
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
91+
const VpnHttp3UpstreamConfig &h3_config = this->PROTOCOL_CONFIG->http3;
9092

9193
// Let the connection live long enough to perform a health check.
9294
m_max_idle_timeout = 2 * (upstream_config.timeout + upstream_config.health_check_timeout);
9395
m_h3_settings.max_idle_timeout = Micros{m_max_idle_timeout};
96+
m_h3_settings.quic_version = h3_config.quic_version;
9497
m_h3_settings.initial_max_data = QUIC_CONNECTION_WINDOW_SIZE;
9598
m_h3_settings.initial_max_stream_data_bidi_local = QUIC_STREAM_WINDOW_SIZE;
9699
m_h3_settings.initial_max_stream_data_bidi_remote = QUIC_STREAM_WINDOW_SIZE;

core/src/vpn_fsm.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ static void run_ping(void *ctx, void *) {
286286
.anti_dpi = vpn->upstream_config->anti_dpi,
287287
.handoff = true,
288288
.quic_max_idle_timeout_ms = quic_max_idle_timeout,
289+
.quic_version = 0,
289290
};
290291

291292
// Speed up recovery if we have already connected through a relay by pinging through the relay in parallel.

net/include/net/locations_pinger.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ typedef struct {
3939
// If `true`, pass the connection state with the ping result.
4040
const VpnRelay *relay_parallel; // Ping through this relay in parallel with normal pings.
4141
uint32_t quic_max_idle_timeout_ms; // QUIC connection max idle timeout. Set `0` to use the default.
42+
uint32_t quic_version; // QUIC version. Set `0` to use the default.
4243
} LocationsPingerInfo;
4344

4445
typedef struct {

net/include/net/quic_connector.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ struct QuicConnectorConnectParameters {
5050
SSL *ssl;
5151
Millis timeout; // How long to wait for server response before giving up.
5252
Millis max_idle_timeout; // QUIC connection's maximum idle timeout.
53+
uint32_t quic_version;
5354
};
5455

5556
struct QuicConnectorResult {

net/src/locations_pinger.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ struct LocationsPinger {
8181
bool handoff;
8282
AutoVpnRelay relay_parallel;
8383
uint32_t quic_max_idle_timeout_ms;
84+
uint32_t quic_version;
8485
};
8586

8687
struct FinalizeLocationInfo {
@@ -262,7 +263,7 @@ static void start_location_ping(LocationsPinger *pinger) {
262263
{i->info->endpoints.data, i->info->endpoints.size}, pinger->timeout_ms,
263264
{pinger->interfaces.data(), pinger->interfaces.size()}, pinger->rounds, pinger->main_protocol,
264265
pinger->anti_dpi, pinger->handoff, {i->info->relays.data, i->info->relays.size}, *pinger->relay_parallel,
265-
pinger->quic_max_idle_timeout_ms};
266+
pinger->quic_max_idle_timeout_ms, pinger->quic_version};
266267
Ping *ping = ping_start(&ping_info, {ping_handler, pinger});
267268

268269
// Must be extracted before pop_front() invalidates the iterator, and before finalize_location()
@@ -313,6 +314,7 @@ LocationsPinger *locations_pinger_start(const LocationsPingerInfo *info, Locatio
313314
pinger->anti_dpi = info->anti_dpi;
314315
pinger->handoff = info->handoff;
315316
pinger->quic_max_idle_timeout_ms = info->quic_max_idle_timeout_ms;
317+
pinger->quic_version = info->quic_version;
316318
if (info->relay_parallel) {
317319
pinger->relay_parallel = vpn_relay_clone(info->relay_parallel);
318320
}

net/src/ping.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ struct Ping {
116116
bool handoff;
117117

118118
uint32_t quic_max_idle_timeout_ms;
119+
uint32_t quic_version;
119120

120121
int minimum_round_timeout_ms;
121122
};
@@ -237,6 +238,7 @@ static void do_connect(void *arg, bool shortcut) {
237238
.ssl = conn->ssl.release(), // Always consumed by `quic_connector_connect`.
238239
.timeout = Millis{self->round_timeout_ms},
239240
.max_idle_timeout = Millis{self->quic_max_idle_timeout_ms},
241+
.quic_version = self->quic_version,
240242
};
241243
error = quic_connector_connect(conn->quic_connector.get(), &parameters);
242244
} else {
@@ -594,6 +596,7 @@ Ping *ping_start(const PingInfo *info, PingHandler handler) {
594596
constexpr auto TIMEOUT_MULTIPLIER = 10;
595597
self->quic_max_idle_timeout_ms = info->quic_max_idle_timeout_ms ? info->quic_max_idle_timeout_ms
596598
: TIMEOUT_MULTIPLIER * DEFAULT_PING_TIMEOUT_MS;
599+
self->quic_version = info->quic_version;
597600
#endif
598601

599602
constexpr uint32_t DEFAULT_IF_IDX = 0;

net/src/ping.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ struct PingInfo {
6464

6565
/// QUIC parameters. Set 0 to use defaults.
6666
uint32_t quic_max_idle_timeout_ms = 0;
67+
uint32_t quic_version = 0;
6768
};
6869

6970
struct PingHandler {

0 commit comments

Comments
 (0)