]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: htx: check the HTX compatibility in dynamic use-backend rules
authorWilly Tarreau <w@1wt.eu>
Fri, 1 Feb 2019 14:06:09 +0000 (15:06 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 Feb 2019 14:09:54 +0000 (15:09 +0100)
I would have sworn it was done, probably we lost it during the refactoring.
If a frontend is in HTX and the backend not (and conersely), this is
normally detected at config parsing time unless the rule is dynamic. In
this case we must abort with an error 500. The logs will report "RR"
(resource issue while processing request) with the frontend and the
backend assigned, so that it's possible to figure what was attempted.

This must be backported to 1.9.

src/proxy.c

index f8d22b63362628fd2ca37f704c43cd9ab4a96de0..7721008b04f3d1cc2d218c81c46b7fdb65534eaa 100644 (file)
@@ -1324,6 +1324,10 @@ int stream_set_backend(struct stream *s, struct proxy *be)
                             HA_ATOMIC_ADD(&be->beconn, 1));
        proxy_inc_be_ctr(be);
 
+       /* HTX/legacy must match */
+       if ((s->sess->fe->options2 ^ be->options2) & PR_O2_USE_HTX)
+               return 0;
+
        /* assign new parameters to the stream from the new backend */
        s->si[1].flags &= ~SI_FL_INDEP_STR;
        if (be->options2 & PR_O2_INDEPSTR)