]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ngtcp2: handshake timeout should be equal to --connect-timeout
authorXCas13 <xcas13@gmail.com>
Fri, 29 Aug 2025 09:52:25 +0000 (13:52 +0400)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 29 Aug 2025 13:59:06 +0000 (15:59 +0200)
Default timeout is hardcoded (10 seconds) and doesn't respect
--connect-timeout parameter. In some cases 10 seconds can be not enough
or too long to "establish a connection". Moreover the non-working
--connect-timeout parameter for http3 is confusing. This change makes
the handshake timeout equal to --connect-timeout, if it's set.
Discussion is here https://github.com/curl/curl/discussions/18427

Closes #18431

lib/vquic/curl_ngtcp2.c

index 575ebb9022e09c00795bbf4dcc0a10d5dfc9c60d..6470f1506d15f65c9d763c31dd40acdb3d639270 100644 (file)
@@ -431,9 +431,9 @@ static void quic_settings(struct cf_ngtcp2_ctx *ctx,
   s->log_printf = NULL;
 #endif
 
-  (void)data;
   s->initial_ts = pktx->ts;
-  s->handshake_timeout = QUIC_HANDSHAKE_TIMEOUT;
+  s->handshake_timeout = (data->set.connecttimeout > 0) ?
+    data->set.connecttimeout * NGTCP2_MILLISECONDS : QUIC_HANDSHAKE_TIMEOUT;
   s->max_window = 100 * ctx->max_stream_window;
   s->max_stream_window = 10 * ctx->max_stream_window;