From: Thierry FOURNIER Date: Fri, 31 Jul 2015 06:50:51 +0000 (+0200) Subject: MINOR: proto_http: use an "expr" type in place of generic opaque type. X-Git-Tag: v1.6-dev4~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a002dc9df8643d302bcc36b96d23b999ffff9338;p=thirdparty%2Fhaproxy.git MINOR: proto_http: use an "expr" type in place of generic opaque type. 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" --- diff --git a/include/types/action.h b/include/types/action.h index dcb75d2cc5..436c7fb028 100644 --- a/include/types/action.h +++ b/include/types/action.h @@ -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; diff --git a/src/proto_http.c b/src/proto_http.c index 123d371c4d..bc116d6f16 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -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;