From 949b6ca961904c7414fc22204461f9882afff4ea Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 10 Sep 2021 10:29:54 +0200 Subject: [PATCH] BUG/MINOR: filters: Set right FLT_END analyser depending on channel A bug was introduced by the commit 26eb5ea35 ("BUG/MINOR: filters: Always set FLT_END analyser when CF_FLT_ANALYZE flag is set"). Depending on the channel evaluated, the rigth FLT_END analyser must be set. AN_REQ_FLT_END for the request channel and AN_RES_FLT_END for the response one. Ths patch must be backported everywhere the above commit was backported. --- src/filters.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/filters.c b/src/filters.c index 7640464e27..136a3e80b3 100644 --- a/src/filters.c +++ b/src/filters.c @@ -537,7 +537,7 @@ flt_set_stream_backend(struct stream *s, struct proxy *be) } if (be->be_req_ana & AN_REQ_FLT_START_BE) { s->req.flags |= CF_FLT_ANALYZE; - s->req.analysers |= AN_RES_FLT_END; + s->req.analysers |= AN_REQ_FLT_END; } if ((strm_fe(s)->fe_rsp_ana | be->be_rsp_ana) & (AN_RES_FLT_START_FE|AN_RES_FLT_START_BE)) { s->res.flags |= CF_FLT_ANALYZE; @@ -712,7 +712,7 @@ flt_start_analyze(struct stream *s, struct channel *chn, unsigned int an_bit) /* Set flag on channel to tell that the channel is filtered */ chn->flags |= CF_FLT_ANALYZE; - chn->analysers |= AN_RES_FLT_END; + chn->analysers |= ((chn->flags & CF_ISRESP) ? AN_RES_FLT_END : AN_REQ_FLT_END); RESUME_FILTER_LOOP(s, chn) { if (!(chn->flags & CF_ISRESP)) {