]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: action: Add a sample expression field in arguments used by HTTP actions
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Apr 2026 12:00:24 +0000 (14:00 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Apr 2026 14:34:37 +0000 (16:34 +0200)
This could be useful for some HTTP actions. It was possible to rely on a
log-format string. It is now possible to also use a sample expression.

include/haproxy/action-t.h
src/http_act.c

index 984f55c64521cba75c300917387aba425264d636..490005c71c5b88b31c35535ac59b7df176e1f4b0 100644 (file)
@@ -151,6 +151,7 @@ struct act_rule {
                        struct ist str;        /* string param (reason, header name, ...) */
                        struct lf_expr fmt;    /* log-format compatible expression */
                        struct my_regex *re;   /* used by replace-header/value/uri/path */
+                       struct sample_expr *expr; /* sample expression used by HTTP action */
                } http;                        /* args used by some HTTP rules */
                struct http_reply *http_reply; /* HTTP response to be used by return/deny/tarpit rules */
                struct redirect_rule *redir;   /* redirect rule or "http-request redirect" */
index b8d3ce3fb9a91d872655fb77c73a9268254ca863..514d20173106f9807d6d74470d5d071598686c8a 100644 (file)
@@ -51,6 +51,7 @@ static void release_http_action(struct act_rule *rule)
        if (rule->arg.http.re)
                regex_free(rule->arg.http.re);
        lf_expr_deinit(&rule->arg.http.fmt);
+       release_sample_expr(rule->arg.http.expr);
 }
 
 /* Release memory allocated by HTTP actions relying on an http reply. Concretely,