]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: filters: Set right FLT_END analyser depending on channel
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 10 Sep 2021 08:29:54 +0000 (10:29 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 10 Sep 2021 08:35:53 +0000 (10:35 +0200)
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

index 7640464e27a193b91387d28647e7c1519ba1ccf2..136a3e80b38758da87d5fd15e1437210e7fdcb4d 100644 (file)
@@ -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)) {