]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ngtcp2: overwrite rate-limits defaults
authorStefan Eissing <stefan@eissing.org>
Wed, 29 Oct 2025 08:48:50 +0000 (09:48 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 29 Oct 2025 12:34:27 +0000 (13:34 +0100)
In pytests test_08 with the Caddy server, the new rate-limiting in
ngtcp2 did close the connection because it found "too many" stream data
packet repeats.

It is unclear if this is some Caddy issue or if the ngtcp2 implementaton
is wrong. Or if curl can do anything here.

Reported as https://github.com/ngtcp2/ngtcp2/issues/1850

This PR overwrites the ratelimit defaults in ngtcp2 with ten times
increased values. This makes the errors disappear on macOS.

Enable test_08_04/05 in CI again to see if there are any issues
to be found there. (We had those disabled before having parallel
pytests.)

Closes #19274

lib/vquic/curl_ngtcp2.c
tests/http/test_08_caddy.py

index 3493f996cee197e1227f82c33eec9fe74e5ba2d8..f72f6630f5230d2993313ac6944eed62aa938825 100644 (file)
@@ -457,17 +457,6 @@ static void quic_settings(struct cf_ngtcp2_ctx *ctx,
                           struct Curl_easy *data,
                           struct pkt_io_ctx *pktx)
 {
-#ifdef NGTCP2_SETTINGS_V2x
-static uint16_t mtu_probes[] = {
-  1472, /* what h2o offers */
-  1452, /* what Caddy offers */
-  1454 - 48, /* The well known MTU used by a domestic optic fiber
-                service in Japan. */
-  1390 - 48, /* Typical Tunneled MTU */
-  1280 - 48, /* IPv6 minimum MTU */
-  1492 - 48, /* PPPoE */
-};
-#endif
   ngtcp2_settings *s = &ctx->settings;
   ngtcp2_transport_params *t = &ctx->transport_params;
 
@@ -485,12 +474,11 @@ static uint16_t mtu_probes[] = {
   s->max_window = 100 * ctx->max_stream_window;
   s->max_stream_window = 10 * ctx->max_stream_window;
   s->no_pmtud = FALSE;
-#ifdef NGTCP2_SETTINGS_V2x
-  s->pmtud_probes = mtu_probes;
-  s->pmtud_probeslen = CURL_ARRAYSIZE(mtu_probes);
-  s->max_tx_udp_payload_size = 64 * 1024; /* mtu_probes[0]; */
+#ifdef NGTCP2_SETTINGS_V3
+  /* try ten times the ngtcp2 defaults here for problems with Caddy */
+  s->glitch_ratelim_burst = 1000 * 10;
+  s->glitch_ratelim_rate = 33 * 10;
 #endif
-
   t->initial_max_data = 10 * ctx->max_stream_window;
   t->initial_max_stream_data_bidi_local = ctx->max_stream_window;
   t->initial_max_stream_data_bidi_remote = ctx->max_stream_window;
index 3073607e043ca753392d5ca1496784fb538a4bc5..319ffeb9626808a640bef17ba24ceb5fa08a9e2d 100644 (file)
@@ -108,7 +108,6 @@ class TestCaddy:
 
     # download 5MB files sequentially
     @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests")
-    @pytest.mark.skipif(condition=Env().ci_run, reason="not suitable for CI runs")
     @pytest.mark.parametrize("proto", ['h2', 'h3'])
     def test_08_04a_download_10mb_sequential(self, env: Env, caddy: Caddy, proto):
         if proto == 'h3' and not env.have_h3_curl():
@@ -121,7 +120,6 @@ class TestCaddy:
 
     # download 10MB files sequentially
     @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests")
-    @pytest.mark.skipif(condition=Env().ci_run, reason="not suitable for CI runs")
     @pytest.mark.parametrize("proto", ['h2', 'h3'])
     def test_08_04b_download_10mb_sequential(self, env: Env, caddy: Caddy, proto):
         if proto == 'h3' and not env.have_h3_curl():
@@ -135,7 +133,6 @@ class TestCaddy:
     # download 10MB files parallel
     @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests")
     @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
-    @pytest.mark.skipif(condition=Env().ci_run, reason="not suitable for CI runs")
     def test_08_05_download_1mb_parallel(self, env: Env, caddy: Caddy, proto):
         if proto == 'h3' and not env.have_h3_curl():
             pytest.skip("h3 not supported in curl")