Amaury Denoyelle | c8b4ce4 | 2022-01-11 11:54:59 +0100 | [diff] [blame] | 1 | #include <haproxy/api.h> |
Amaury Denoyelle | 97e84c6 | 2022-04-19 18:26:55 +0200 | [diff] [blame] | 2 | #include <haproxy/cfgparse.h> |
| 3 | #include <haproxy/global-t.h> |
Amaury Denoyelle | c8b4ce4 | 2022-01-11 11:54:59 +0100 | [diff] [blame] | 4 | #include <haproxy/listener.h> |
| 5 | #include <haproxy/proxy-t.h> |
Amaury Denoyelle | 97e84c6 | 2022-04-19 18:26:55 +0200 | [diff] [blame] | 6 | #include <haproxy/tools.h> |
Amaury Denoyelle | c8b4ce4 | 2022-01-11 11:54:59 +0100 | [diff] [blame] | 7 | |
Amaury Denoyelle | b76ae69 | 2022-01-11 14:16:37 +0100 | [diff] [blame] | 8 | static int bind_parse_quic_force_retry(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err) |
| 9 | { |
| 10 | conf->quic_force_retry = 1; |
| 11 | return 0; |
| 12 | } |
| 13 | |
Amaury Denoyelle | c8b4ce4 | 2022-01-11 11:54:59 +0100 | [diff] [blame] | 14 | static struct bind_kw_list bind_kws = { "QUIC", { }, { |
Amaury Denoyelle | b76ae69 | 2022-01-11 14:16:37 +0100 | [diff] [blame] | 15 | { "quic-force-retry", bind_parse_quic_force_retry, 0 }, |
Amaury Denoyelle | c8b4ce4 | 2022-01-11 11:54:59 +0100 | [diff] [blame] | 16 | { NULL, NULL, 0 }, |
| 17 | }}; |
| 18 | |
| 19 | INITCALL1(STG_REGISTER, bind_register_keywords, &bind_kws); |
Amaury Denoyelle | 97e84c6 | 2022-04-19 18:26:55 +0200 | [diff] [blame] | 20 | |
| 21 | static int cfg_parse_quic_conn_buf_limit(char **args, int section_type, |
| 22 | struct proxy *curpx, |
| 23 | const struct proxy *defpx, |
| 24 | const char *file, int line, char **err) |
| 25 | { |
| 26 | unsigned int arg = 0; |
| 27 | |
| 28 | if (too_many_args(1, args, err, NULL)) |
| 29 | return -1; |
| 30 | |
| 31 | if (*(args[1]) != 0) |
| 32 | arg = atoi(args[1]); |
| 33 | |
| 34 | if (arg < 1) { |
| 35 | memprintf(err, "'%s' expects a positive integer.", args[0]); |
| 36 | return -1; |
| 37 | } |
| 38 | |
| 39 | global.tune.quic_streams_buf = arg; |
| 40 | |
| 41 | return 0; |
| 42 | } |
| 43 | |
| 44 | static struct cfg_kw_list cfg_kws = {ILH, { |
| 45 | { CFG_GLOBAL, "tune.quic.conn-buf-limit", cfg_parse_quic_conn_buf_limit }, |
| 46 | { 0, NULL, NULL } |
| 47 | }}; |
| 48 | |
| 49 | INITCALL1(STG_REGISTER, cfg_register_keywords, &cfg_kws); |