BUG/MINOR: compression: properly disable request when setting response

In 2.8, commit ead43fe4f2 ("MEDIUM: compression: Make it so we can
compress requests as well.") added the ability to independently enable
compression on request and/or response. However there's a bug in the
"compression direction response" case, which preserves only the request
flag and adds the response direction instead of clearing the request
flag, so this directive would clear offload and make it impossible to
disable request if it was already previously enabled.

This can be backported to stable releases as far as 2.8.
This commit is contained in:
Willy Tarreau 2026-04-23 11:00:11 +02:00
parent 686f8db79b
commit 055726a4c9

View File

@ -997,7 +997,7 @@ parse_compression_options(char **args, int section, struct proxy *proxy,
comp->flags &= ~COMP_FL_DIR_RES;
comp->flags |= COMP_FL_DIR_REQ;
} else if (strcmp(args[2], "response") == 0) {
comp->flags &= COMP_FL_DIR_REQ;
comp->flags &= ~COMP_FL_DIR_REQ;
comp->flags |= COMP_FL_DIR_RES;
} else if (strcmp(args[2], "both") == 0)
comp->flags |= COMP_FL_DIR_REQ | COMP_FL_DIR_RES;