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.
This commit is contained in:
Amaury Denoyelle 2025-12-01 12:44:50 +01:00
parent c641ea4f9b
commit acbb378136
2 changed files with 5 additions and 15 deletions

View 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;
}

View 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);
}