]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: lua: Fix test on the direction to set the channel exp timeout
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 14 Aug 2019 21:19:45 +0000 (23:19 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 14 Aug 2019 21:29:18 +0000 (23:29 +0200)
This bug was introduced by the commit bfab2ddd ("MINOR: hlua: Add a flag on the
lua txn to know in which context it can be used"). The wrong test was done. So
the timeout was always set on the response channel. It may lead to an infinite
loop.

This patch must be backported everywhere the commit bfab2ddd is. For now, at
least to 2.0, 1.9 and 1.8.

src/hlua.c

index 9ecf03210d70e833906d771ac779d3f224898f23..c76abc6483f740966cfc263225f969a50200a6b4 100644 (file)
@@ -6230,7 +6230,7 @@ static enum act_return hlua_action(struct act_rule *rule, struct proxy *px,
        case HLUA_E_AGAIN:
                /* Set timeout in the required channel. */
                if (s->hlua->wake_time != TICK_ETERNITY) {
-                       if (dir & SMP_OPT_DIR_REQ)
+                       if (dir == SMP_OPT_DIR_REQ)
                                s->req.analyse_exp = s->hlua->wake_time;
                        else
                                s->res.analyse_exp = s->hlua->wake_time;