mirror of
https://github.com/haproxy/haproxy.git
synced 2026-07-15 03:56:56 -04:00
MINOR: compression: try init in cfgparse.c
Try to init and deinit the algorithm in the configuration parser and exit with error if it doesn't work.
This commit is contained in:
parent
2b50247695
commit
552df67100
1 changed files with 10 additions and 0 deletions
|
|
@ -5296,6 +5296,8 @@ stats_error_parsing:
|
|||
|
||||
if (!strcmp(args[1], "algo")) {
|
||||
int cur_arg;
|
||||
struct comp_ctx ctx;
|
||||
|
||||
cur_arg = 2;
|
||||
if (!*args[cur_arg]) {
|
||||
Alert("parsing [%s:%d] : '%s' expects <algorithm>\n",
|
||||
|
|
@ -5310,6 +5312,14 @@ stats_error_parsing:
|
|||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
goto out;
|
||||
}
|
||||
if (curproxy->comp->algos->init(&ctx, 9) == 0) {
|
||||
curproxy->comp->algos->end(&ctx);
|
||||
} else {
|
||||
Alert("parsing [%s:%d] : '%s' : Can't init '%s' algorithm.\n",
|
||||
file, linenum, args[0], args[cur_arg]);
|
||||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
goto out;
|
||||
}
|
||||
cur_arg ++;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue