]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
Revert "MINOR: quic: use dynamic cc_algo on bind_conf"
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 1 Dec 2025 11:44:50 +0000 (12:44 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 1 Dec 2025 13:18:58 +0000 (14:18 +0100)
This reverts commit a6504c9cfb6bb48ae93babb76a2ab10ddb014a79.

Each supported QUIC algo are associated with a set of callbacks defined
in a structure quic_cc_algo. Originally, bind_conf would use a constant
pointer to one of these definitions.

During pacing implementation, this field was transformed into a
dynamically allocated value copied from the original definition. The
idea was to be able to tweak settings at the listener level. However,
this was never used in practice. As such, revert to the original model.

This may need to be backported to support QUIC congestion control
algorithm support on the server line in version 3.3.

src/cfgparse-quic.c
src/proxy.c

index 1a1f840470754cd212ab9ed824ecbe1a068f2d13..334d71eb70bd126eed7ad98f689b9d7ef4efbd58 100644 (file)
@@ -101,17 +101,11 @@ static unsigned long parse_window_size(const char *kw, char *value,
 static int bind_parse_quic_cc_algo(char **args, int cur_arg, struct proxy *px,
                                    struct bind_conf *conf, char **err)
 {
-       struct quic_cc_algo *cc_algo = NULL;
+       struct quic_cc_algo *cc_algo;
        const char *algo = NULL;
        struct ist algo_ist, arg_ist;
        char *arg;
 
-       cc_algo = calloc(1, sizeof(struct quic_cc_algo));
-       if (!cc_algo) {
-               memprintf(err, "'%s' : out of memory", args[cur_arg]);
-               goto fail;
-       }
-
        if (!*args[cur_arg + 1]) {
                memprintf(err, "'%s' : missing control congestion algorithm", args[cur_arg]);
                goto fail;
@@ -123,19 +117,19 @@ static int bind_parse_quic_cc_algo(char **args, int cur_arg, struct proxy *px,
        if (isteq(algo_ist, ist(QUIC_CC_NEWRENO_STR))) {
                /* newreno */
                algo = QUIC_CC_NEWRENO_STR;
-               *cc_algo = quic_cc_algo_nr;
+               cc_algo = &quic_cc_algo_nr;
                arg += strlen(QUIC_CC_NEWRENO_STR);
        }
        else if (isteq(algo_ist, ist(QUIC_CC_CUBIC_STR))) {
                /* cubic */
                algo = QUIC_CC_CUBIC_STR;
-               *cc_algo = quic_cc_algo_cubic;
+               cc_algo = &quic_cc_algo_cubic;
                arg += strlen(QUIC_CC_CUBIC_STR);
        }
        else if (isteq(algo_ist, ist(QUIC_CC_BBR_STR))) {
                /* bbr */
                algo = QUIC_CC_BBR_STR;
-               *cc_algo = quic_cc_algo_bbr;
+               cc_algo = &quic_cc_algo_bbr;
                arg += strlen(QUIC_CC_BBR_STR);
        }
        else if (isteq(algo_ist, ist(QUIC_CC_NO_CC_STR))) {
@@ -147,7 +141,7 @@ static int bind_parse_quic_cc_algo(char **args, int cur_arg, struct proxy *px,
                }
 
                algo = QUIC_CC_NO_CC_STR;
-               *cc_algo = quic_cc_algo_nocc;
+               cc_algo = &quic_cc_algo_nocc;
                arg += strlen(QUIC_CC_NO_CC_STR);
                mark_tainted(TAINTED_CONFIG_EXP_KW_DECLARED);
        }
@@ -190,7 +184,6 @@ static int bind_parse_quic_cc_algo(char **args, int cur_arg, struct proxy *px,
        return 0;
 
  fail:
-       free(cc_algo);
        return ERR_ALERT | ERR_FATAL;
 }
 
index 429f4b11028200c756087783fc5b1f770b6bebce..ced820343ceb99f1bde7b21062bc9e50bdb4952e 100644 (file)
@@ -412,9 +412,6 @@ void deinit_proxy(struct proxy *p)
                free(bind_conf->rhttp_srvname);
                free(bind_conf->tcp_md5sig);
                free(bind_conf->cc_algo);
-#ifdef USE_QUIC
-               free(bind_conf->quic_cc_algo);
-#endif
                free(bind_conf);
        }