MINOR: flt_http_comp: "compression" requires TCP or HTTP mode

Prevent the use of "compression" keyword in proxy sections when the proxy
is neither in tcp or http mode.
This commit is contained in:
Aurelien DARRAGON 2023-09-19 18:02:00 +02:00 committed by Christopher Faulet
parent 1e0093a317
commit 225526dc16
1 changed files with 6 additions and 0 deletions

View File

@ -789,6 +789,12 @@ parse_compression_options(char **args, int section, struct proxy *proxy,
else
comp = proxy->comp;
if (proxy->mode != PR_MODE_TCP && proxy->mode != PR_MODE_HTTP) {
memprintf(err, "parsing [%s:%d] : '%s' requires TCP or HTTP mode.",
file, line, args[0]);
ret = -1;
goto end;
}
if (strcmp(args[1], "algo") == 0 || strcmp(args[1], "algo-res") == 0) {
struct comp_ctx *ctx;
int cur_arg = 2;