mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-01 22:48:25 +00:00
MINOR: compression: Make compression offload a flag
Turn compression offload into a flag in struct comp, instead of using an int just for it.
This commit is contained in:
parent
6bb26d41fe
commit
3ce0f01b81
@ -34,10 +34,13 @@
|
||||
|
||||
#include <haproxy/buf-t.h>
|
||||
|
||||
/* Compression flags */
|
||||
|
||||
#define COMP_FL_OFFLOAD 0x00000001 /* Compression offload */
|
||||
struct comp {
|
||||
struct comp_algo *algos;
|
||||
struct comp_type *types;
|
||||
unsigned int offload;
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
struct comp_ctx {
|
||||
|
@ -451,8 +451,8 @@ select_compression_request_header(struct comp_state *st, struct stream *s, struc
|
||||
|
||||
/* remove all occurrences of the header when "compression offload" is set */
|
||||
if (st->comp_algo) {
|
||||
if ((s->be->comp && s->be->comp->offload) ||
|
||||
(strm_fe(s)->comp && strm_fe(s)->comp->offload)) {
|
||||
if ((s->be->comp && (s->be->comp->flags & COMP_FL_OFFLOAD)) ||
|
||||
(strm_fe(s)->comp && (strm_fe(s)->comp->flags & COMP_FL_OFFLOAD))) {
|
||||
http_remove_header(htx, &ctx);
|
||||
ctx.blk = NULL;
|
||||
while (http_find_header(htx, ist("Accept-Encoding"), &ctx, 1))
|
||||
@ -690,7 +690,7 @@ parse_compression_options(char **args, int section, struct proxy *proxy,
|
||||
args[0], args[1]);
|
||||
ret = 1;
|
||||
}
|
||||
comp->offload = 1;
|
||||
comp->flags |= COMP_FL_OFFLOAD;
|
||||
}
|
||||
else if (strcmp(args[1], "type") == 0) {
|
||||
int cur_arg = 2;
|
||||
|
Loading…
Reference in New Issue
Block a user