From: Willy Tarreau Date: Fri, 1 Feb 2019 14:06:09 +0000 (+0100) Subject: BUG/MEDIUM: htx: check the HTX compatibility in dynamic use-backend rules X-Git-Tag: v2.0-dev1~81 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=3e451842dcd5f2d6f063156e2fa4b78195f097e6;p=haproxy-2.1.git BUG/MEDIUM: htx: check the HTX compatibility in dynamic use-backend rules 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. --- diff --git a/src/proxy.c b/src/proxy.c index f8d22b6..7721008 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -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)