]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proto_http: use an "expr" type in place of generic opaque type.
authorThierry FOURNIER <tfournier@arpalert.org>
Fri, 31 Jul 2015 06:50:51 +0000 (08:50 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Aug 2015 15:13:46 +0000 (17:13 +0200)
This patch removes the generic opaque type for storing the configuration of the
acion "set-src" (HTTP_REQ_ACT_SET_SRC), and use the dedicated type "struct expr"

include/types/action.h
src/proto_http.c

index dcb75d2cc5527f2f86c31521c94aff99b3e04fef..436c7fb0288f220c6e04cf6ba48f9eb3b180a1a6 100644 (file)
@@ -56,6 +56,7 @@ struct act_rule {
                        struct list key;       /* pattern to retrieve MAP or ACL key */
                        struct list value;     /* pattern to retrieve MAP value */
                } map;
+               struct sample_expr *expr;
                struct hlua_rule *hlua_rule;
                struct {
                        struct sample_expr *expr;
index 123d371c4dcf4a837dcdccf5563cd0681c4b7d31..bc116d6f1652c9d38b447bd150409780353f0518 100644 (file)
@@ -3679,7 +3679,7 @@ resume_execution:
                        if ((cli_conn = objt_conn(sess->origin)) && conn_ctrl_ready(cli_conn)) {
                                struct sample *smp;
 
-                               smp = sample_fetch_as_type(px, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, rule->arg.act.p[0], SMP_T_ADDR);
+                               smp = sample_fetch_as_type(px, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, rule->arg.expr, SMP_T_ADDR);
 
                                if (smp) {
                                        if (smp->data.type == SMP_T_IPV4) {
@@ -9345,7 +9345,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
                        goto out_err;
                }
 
-               rule->arg.act.p[0] = expr;
+               rule->arg.expr = expr;
                rule->action = HTTP_REQ_ACT_SET_SRC;
        } else if (((custom = action_http_req_custom(args[0])) != NULL)) {
                char *errmsg = NULL;