]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http-act: Properly handle final evaluation in pause action
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 2 Jun 2026 11:38:14 +0000 (13:38 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 2 Jun 2026 14:25:48 +0000 (16:25 +0200)
The ACT_OPT_FINAL flag was not properly handled in the pause action. When
this flag is set, because of an abort or an unexpected error, an action must
no longer yield. However, in the pause action, this flag was never tested.
In case of client abort for instance, this could trigger an internal error
instead of a client error.

This patch should fix the issue #3403. It must be backported as far as 3.2.

src/http_act.c

index 9b9b5207da39ad3bdbf8bdc07ae25c43be68f67f..9f6b1871e62b6de70f1dbf7953e3d6b3cd9f573b 100644 (file)
@@ -2082,6 +2082,9 @@ static enum act_return http_action_pause(struct act_rule *rule, struct proxy *px
        struct channel *chn = ((rule->from == ACT_F_HTTP_REQ) ? &s->req : &s->res);
        struct sample *key;
 
+       if (flags & ACT_OPT_FINAL)
+               goto end;
+
        if (!tick_isset(chn->analyse_exp)) {
                int time;
 
@@ -2099,6 +2102,7 @@ static enum act_return http_action_pause(struct act_rule *rule, struct proxy *px
        if (tick_isset(chn->analyse_exp) && !tick_is_expired(chn->analyse_exp, now_ms))
                return ACT_RET_YIELD;
 
+  end:
        chn->analyse_exp = TICK_ETERNITY;
        return ACT_RET_CONT;
 }