#include <haproxy/stream.h>
#include <haproxy/tools.h>
+#define COMP_STATE_PROCESSING 0x01
+
const char *http_comp_flt_id = "compression filter";
struct flt_ops comp_ops;
struct comp_state {
struct comp_ctx *comp_ctx; /* compression context */
struct comp_algo *comp_algo; /* compression algorithm if not NULL */
+ unsigned int flags; /* COMP_STATE_* */
};
/* Pools used to allocate comp_state structs */
st->comp_algo = NULL;
st->comp_ctx = NULL;
+ st->flags = 0;
filter->ctx = st;
/* Register post-analyzer on AN_RES_WAIT_HTTP because we need to
if (!set_compression_response_header(st, s, msg))
goto end;
register_data_filter(s, msg->chn, filter);
+ st->flags |= COMP_STATE_PROCESSING;
}
}
case HTX_BLK_TLR:
case HTX_BLK_EOT:
case HTX_BLK_EOM:
- if (msg->flags & HTTP_MSGF_COMPRESSING) {
+ if (st->flags & COMP_STATE_PROCESSING) {
if (htx_compression_buffer_init(htx, &trash) < 0) {
msg->chn->flags |= CF_WAKE_WRITE;
goto end;
}
/* We let the mux add last empty chunk and empty trailers */
}
+ st->flags &= ~COMP_STATE_PROCESSING;
/* fall through */
default: