]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: maximum window limits do not match the doc
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 13 Nov 2023 18:56:28 +0000 (19:56 +0100)
committerFrédéric Lécaille <flecaille@haproxy.com>
Mon, 13 Nov 2023 18:56:28 +0000 (19:56 +0100)
This bug arrived with this commit:
     MINOR: quic: Add a max window parameter to congestion control algorithms

The documentation was been modified with missing/wrong modifications in the code part.
The 'g' suffix must be accepted to parse value in gigabytes. And exctly 4g is
also accepted.

No need to backport.

src/cfgparse-quic.c

index 6ca83c8123a25e42d11df40c10ce9d52c9e5ad6b..80294085030390cba1dd2059d45c8a6958a6a09e 100644 (file)
@@ -82,8 +82,8 @@ static int bind_parse_quic_cc_algo(char **args, int cur_arg, struct proxy *px,
                        end_opt++;
                }
                else if (*end_opt == 'g') {
-                       memprintf(err, "'%s' : should be smaller than 1g", args[cur_arg + 1]);
-                       goto fail;
+                       cwnd <<= 30;
+                       end_opt++;
                }
 
                if (*end_opt != ')') {
@@ -91,7 +91,7 @@ static int bind_parse_quic_cc_algo(char **args, int cur_arg, struct proxy *px,
                        goto fail;
                }
 
-               if (cwnd < 10240 || cwnd >= (4UL << 30)) {
+               if (cwnd < 10240 || cwnd > (4UL << 30)) {
                        memprintf(err, "'%s' : should be greater than 10k and smaller than 4g", args[cur_arg + 1]);
                        goto fail;
                }