mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-01 01:32:04 +00:00
MINOR: quic: Add tune.quic.retry-threshold keyword
This QUIC specific keyword may be used to set the theshold, in number of connection openings, beyond which QUIC Retry feature will be automatically enabled. Its default value is 100.
This commit is contained in:
parent
cbd59c7ab6
commit
9286210aa8
@ -158,6 +158,7 @@ struct global {
|
||||
int pool_high_count; /* max number of opened fd before we start killing idle connections when creating new connections */
|
||||
unsigned short idle_timer; /* how long before an empty buffer is considered idle (ms) */
|
||||
#ifdef USE_QUIC
|
||||
unsigned int quic_retry_threshold;
|
||||
unsigned int quic_streams_buf;
|
||||
#endif /* USE_QUIC */
|
||||
} tune;
|
||||
|
@ -92,6 +92,8 @@ typedef unsigned long long ull;
|
||||
#define QUIC_RETRY_TOKEN_SALTLEN 16 /* bytes */
|
||||
/* Retry token duration */
|
||||
#define QUIC_RETRY_DURATION_MS 10000
|
||||
/* Default Retry threshold */
|
||||
#define QUIC_DFLT_RETRY_THRESHOLD 100 /* in connection openings */
|
||||
|
||||
/*
|
||||
* 0 1 2 3
|
||||
|
@ -18,12 +18,16 @@ static struct bind_kw_list bind_kws = { "QUIC", { }, {
|
||||
|
||||
INITCALL1(STG_REGISTER, bind_register_keywords, &bind_kws);
|
||||
|
||||
static int cfg_parse_quic_conn_buf_limit(char **args, int section_type,
|
||||
struct proxy *curpx,
|
||||
const struct proxy *defpx,
|
||||
const char *file, int line, char **err)
|
||||
/* Parse any tune.quic.* setting with strictly positive integer values.
|
||||
* Return -1 on alert, or 0 if succeeded.
|
||||
*/
|
||||
static int cfg_parse_quic_tune_setting(char **args, int section_type,
|
||||
struct proxy *curpx,
|
||||
const struct proxy *defpx,
|
||||
const char *file, int line, char **err)
|
||||
{
|
||||
unsigned int arg = 0;
|
||||
int prefix_len = strlen("tune.quic.");
|
||||
|
||||
if (too_many_args(1, args, err, NULL))
|
||||
return -1;
|
||||
@ -36,13 +40,21 @@ static int cfg_parse_quic_conn_buf_limit(char **args, int section_type,
|
||||
return -1;
|
||||
}
|
||||
|
||||
global.tune.quic_streams_buf = arg;
|
||||
if (strcmp(args[0] + prefix_len, "conn-buf-limit") == 0)
|
||||
global.tune.quic_streams_buf = arg;
|
||||
else if (strcmp(args[0] + prefix_len, "retry-threshold") == 0)
|
||||
global.tune.quic_retry_threshold = arg;
|
||||
else {
|
||||
memprintf(err, "'%s' keyword not unhandled (please report this bug).", args[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct cfg_kw_list cfg_kws = {ILH, {
|
||||
{ CFG_GLOBAL, "tune.quic.conn-buf-limit", cfg_parse_quic_conn_buf_limit },
|
||||
{ CFG_GLOBAL, "tune.quic.conn-buf-limit", cfg_parse_quic_tune_setting },
|
||||
{ CFG_GLOBAL, "tune.quic.retry-threshold", cfg_parse_quic_tune_setting },
|
||||
{ 0, NULL, NULL }
|
||||
}};
|
||||
|
||||
|
@ -138,6 +138,7 @@
|
||||
#include <haproxy/uri_auth-t.h>
|
||||
#include <haproxy/vars.h>
|
||||
#include <haproxy/version.h>
|
||||
#include <haproxy/xprt_quic-t.h>
|
||||
|
||||
|
||||
/* array of init calls for older platforms */
|
||||
@ -204,6 +205,7 @@ struct global global = {
|
||||
.idle_timer = 1000, /* 1 second */
|
||||
#endif
|
||||
#ifdef USE_QUIC
|
||||
.quic_retry_threshold = QUIC_DFLT_RETRY_THRESHOLD,
|
||||
.quic_streams_buf = 30,
|
||||
#endif /* USE_QUIC */
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user