From: Amaury Denoyelle Date: Mon, 1 Dec 2025 11:44:50 +0000 (+0100) Subject: Revert "MINOR: quic: use dynamic cc_algo on bind_conf" X-Git-Tag: v3.4-dev1~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=acbb378136952f45c2a0706c2fb264799b6c3de8;p=thirdparty%2Fhaproxy.git Revert "MINOR: quic: use dynamic cc_algo on bind_conf" 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. --- diff --git a/src/cfgparse-quic.c b/src/cfgparse-quic.c index 1a1f84047..334d71eb7 100644 --- a/src/cfgparse-quic.c +++ b/src/cfgparse-quic.c @@ -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; } diff --git a/src/proxy.c b/src/proxy.c index 429f4b110..ced820343 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -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); }