mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
[MINOR] config: support a comma-separated list of store data types in stick-table
Sometimes we need to store many data types in stick-tables. Let's support a comma-separated list instead of repeating "store" with each keyword.
This commit is contained in:
parent
f4d17d9071
commit
b084e9ccb9
@ -2276,20 +2276,30 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
|
|||||||
}
|
}
|
||||||
else if (strcmp(args[myidx], "store") == 0) {
|
else if (strcmp(args[myidx], "store") == 0) {
|
||||||
int type;
|
int type;
|
||||||
|
char *cw, *nw;
|
||||||
|
|
||||||
myidx++;
|
myidx++;
|
||||||
type = stktable_get_data_type(args[myidx]);
|
nw = args[myidx];
|
||||||
|
while (*nw) {
|
||||||
|
/* the "store" keyword supports a comma-separated list */
|
||||||
|
cw = nw;
|
||||||
|
while (*nw && *nw != ',')
|
||||||
|
nw++;
|
||||||
|
if (*nw)
|
||||||
|
*nw++ = '\0';
|
||||||
|
type = stktable_get_data_type(cw);
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
Alert("parsing [%s:%d] : %s: unknown store option '%s'.\n",
|
Alert("parsing [%s:%d] : %s: unknown store option '%s'.\n",
|
||||||
file, linenum, args[0], args[myidx]);
|
file, linenum, args[0], cw);
|
||||||
err_code |= ERR_ALERT | ERR_FATAL;
|
err_code |= ERR_ALERT | ERR_FATAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (!stktable_alloc_data_type(&curproxy->table, type)) {
|
if (!stktable_alloc_data_type(&curproxy->table, type)) {
|
||||||
Warning("parsing [%s:%d]: %s: store option '%s' already enabled, ignored.\n",
|
Warning("parsing [%s:%d]: %s: store option '%s' already enabled, ignored.\n",
|
||||||
file, linenum, args[0], args[myidx]);
|
file, linenum, args[0], cw);
|
||||||
err_code |= ERR_WARN;
|
err_code |= ERR_WARN;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
myidx++;
|
myidx++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user