instance, it is possible to force the http/2 on clear TCP by specifying "proto
h2" on the bind line.
+quic-cc-algo [ cubic | newreno ]
+ Warning: QUIC support in HAProxy is currently experimental. Configuration may
+
+ This is a QUIC specific setting to select the congestion control algorithm
+ for any connection attempts to the configured QUIC listeners. They are similar
+ to those used by TCP.
+
+ Default value: cubic
+
quic-force-retry
Warning: QUIC support in HAProxy is currently experimental. Configuration may
change without deprecation in the future.
#include <haproxy/api.h>
#include <haproxy/cfgparse.h>
+#include <haproxy/errors.h>
#include <haproxy/global-t.h>
#include <haproxy/listener.h>
#include <haproxy/proxy-t.h>
+#include <haproxy/quic_cc-t.h>
#include <haproxy/tools.h>
static int bind_parse_quic_force_retry(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
return 0;
}
+/* parse "quic-cc-algo" bind keyword */
+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;
+
+ if (!*args[cur_arg + 1]) {
+ memprintf(err, "'%s' : missing control congestion algorith", args[cur_arg]);
+ return ERR_ALERT | ERR_FATAL;
+ }
+
+ if (!strcmp(args[cur_arg + 1], "newreno"))
+ cc_algo = &quic_cc_algo_nr;
+ else if (!strcmp(args[cur_arg + 1], "cubic"))
+ cc_algo = &quic_cc_algo_cubic;
+ else {
+ memprintf(err, "'%s' : unknown control congestion algorithm", args[cur_arg]);
+ return ERR_ALERT | ERR_FATAL;
+ }
+
+ conf->quic_cc_algo = cc_algo;
+ return 0;
+}
+
static struct bind_kw_list bind_kws = { "QUIC", { }, {
{ "quic-force-retry", bind_parse_quic_force_retry, 0 },
+ { "quic-cc-algo", bind_parse_quic_cc_algo, 1 },
{ NULL, NULL, 0 },
}};
struct quic_connection_id *icid;
char *buf_area = NULL;
struct listener *l = NULL;
+ struct quic_cc_algo *cc_algo = NULL;
TRACE_ENTER(QUIC_EV_CONN_INIT);
qc = pool_zalloc(pool_head_quic_conn);
l = owner;
prx = l->bind_conf->frontend;
+ cc_algo = l->bind_conf->quic_cc_algo;
qc->prx_counters = EXTRA_COUNTERS_GET(prx->extra_counters_fe,
&quic_stats_module);
/* XXX TO DO: Only one path at this time. */
qc->path = &qc->paths[0];
- quic_path_init(qc->path, ipv4, default_quic_cc_algo, qc);
+ quic_path_init(qc->path, ipv4, cc_algo ? cc_algo : default_quic_cc_algo, qc);
/* required to use MTLIST_IN_LIST */
MT_LIST_INIT(&qc->accept_list);