]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stream: Fix how backend-specific analyzers are set on a stream
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 9 Jan 2017 15:33:19 +0000 (16:33 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 13 Jan 2017 10:38:27 +0000 (11:38 +0100)
When the stream's backend was defined, the request's analyzers flag was always
set to 0 if the stream had no listener. This bug was introduced with the filter
API but never triggered (I think so).

Because of the commit 5820a366, it is now possible to encountered it. For
example, this happens when the trace filter is enabled on a SPOE backend. The
fix is pretty trivial.

This fix must be backported to 1.7.

src/proxy.c

index 2d9f06cf580c1644db0a86a32a45d503a27269ec..41e40e666dedd65cac53cc391d1def33a493146c 100644 (file)
@@ -1156,7 +1156,7 @@ int stream_set_backend(struct stream *s, struct proxy *be)
         * be more reliable to store the list of analysers that have been run,
         * but what we do here is OK for now.
         */
-       s->req.analysers |= be->be_req_ana & (strm_li(s) ? ~strm_li(s)->analysers : 0);
+       s->req.analysers |= be->be_req_ana & ~(strm_li(s) ? strm_li(s)->analysers : 0);
 
        /* If the target backend requires HTTP processing, we have to allocate
         * the HTTP transaction and hdr_idx if we did not have one.