mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-12 10:20:00 -04:00
Revert "MINOR: quic: use dynamic cc_algo on bind_conf"
This reverts commit a6504c9cfb.
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:
parent
c641ea4f9b
commit
acbb378136
2 changed files with 5 additions and 15 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue