]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proto_http: replace generic opaque types by real used types in "http_capture"
authorThierry FOURNIER <tfournier@arpalert.org>
Fri, 31 Jul 2015 06:56:16 +0000 (08:56 +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
action "http_capture"".

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

index 188b17fabc1fdaeb55eba2ff9db368a54975ac58..d3781cfbe71d7c89a83b6d718124ff8562970db9 100644 (file)
@@ -61,6 +61,10 @@ struct act_rule {
                        struct list logfmt;
                        int action;
                } http;
+               struct {
+                       struct sample_expr *expr;
+                       struct cap_hdr *hdr;
+               } cap;
                struct hlua_rule *hlua_rule;
                struct {
                        struct sample_expr *expr;
index 23c7eb4f8b3ef0ef448b769ba3a15e6a9385d212..f0ad1c29edb196c14f95848dce897639d07d03b4 100644 (file)
@@ -12320,12 +12320,11 @@ int http_action_req_capture(struct act_rule *rule, struct proxy *px,
                             struct session *sess, struct stream *s)
 {
        struct sample *key;
-       struct sample_expr *expr = rule->arg.act.p[0];
-       struct cap_hdr *h = rule->arg.act.p[1];
+       struct cap_hdr *h = rule->arg.cap.hdr;
        char **cap = s->req_cap;
        int len;
 
-       key = sample_fetch_as_type(s->be, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, expr, SMP_T_STR);
+       key = sample_fetch_as_type(s->be, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, rule->arg.cap.expr, SMP_T_STR);
        if (!key)
                return 1;
 
@@ -12471,8 +12470,8 @@ int parse_http_req_capture(const char **args, int *orig_arg, struct proxy *px, s
 
                rule->action       = HTTP_REQ_ACT_CUSTOM_CONT;
                rule->action_ptr   = http_action_req_capture;
-               rule->arg.act.p[0] = expr;
-               rule->arg.act.p[1] = hdr;
+               rule->arg.cap.expr = expr;
+               rule->arg.cap.hdr  = hdr;
        }
 
        else if (strcmp(args[cur_arg], "id") == 0) {