From 32b15003fe54c86e890e802c4a6ada0170b4cd59 Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER Date: Fri, 31 Jul 2015 08:56:16 +0200 Subject: [PATCH] MINOR: proto_http: replace generic opaque types by real used types in "http_capture" This patch removes the generic opaque type for storing the configuration of the action "http_capture"". --- include/types/action.h | 4 ++++ src/proto_http.c | 9 ++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/types/action.h b/include/types/action.h index 188b17fab..d3781cfbe 100644 --- a/include/types/action.h +++ b/include/types/action.h @@ -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; diff --git a/src/proto_http.c b/src/proto_http.c index 23c7eb4f8..f0ad1c29e 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -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) {