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"".
This commit is contained in:
Thierry FOURNIER 2015-07-31 08:56:16 +02:00 committed by Willy Tarreau
parent 8855a92d8c
commit 32b15003fe
2 changed files with 8 additions and 5 deletions

View File

@ -61,6 +61,10 @@ struct act_rule {
struct list logfmt; struct list logfmt;
int action; int action;
} http; } http;
struct {
struct sample_expr *expr;
struct cap_hdr *hdr;
} cap;
struct hlua_rule *hlua_rule; struct hlua_rule *hlua_rule;
struct { struct {
struct sample_expr *expr; struct sample_expr *expr;

View File

@ -12320,12 +12320,11 @@ int http_action_req_capture(struct act_rule *rule, struct proxy *px,
struct session *sess, struct stream *s) struct session *sess, struct stream *s)
{ {
struct sample *key; struct sample *key;
struct sample_expr *expr = rule->arg.act.p[0]; struct cap_hdr *h = rule->arg.cap.hdr;
struct cap_hdr *h = rule->arg.act.p[1];
char **cap = s->req_cap; char **cap = s->req_cap;
int len; 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) if (!key)
return 1; 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 = HTTP_REQ_ACT_CUSTOM_CONT;
rule->action_ptr = http_action_req_capture; rule->action_ptr = http_action_req_capture;
rule->arg.act.p[0] = expr; rule->arg.cap.expr = expr;
rule->arg.act.p[1] = hdr; rule->arg.cap.hdr = hdr;
} }
else if (strcmp(args[cur_arg], "id") == 0) { else if (strcmp(args[cur_arg], "id") == 0) {