MEDIUM: capture: Move the capture configuration storage in the union

This patch moves the capture configuration struct (capture_prm) in the main
"arg" union. This reduce the size of the struct.
This commit is contained in:
Thierry FOURNIER 2015-08-04 08:21:12 +02:00 committed by Willy Tarreau
parent 5ec63e008d
commit d0d65aeab6
3 changed files with 7 additions and 16 deletions

View File

@ -24,11 +24,6 @@
#include <types/stick_table.h>
struct capture_prm {
struct sample_expr *expr; /* expression used as the key */
struct cap_hdr *hdr; /* the capture storage */
};
struct act_rule {
struct list list;
struct acl_cond *cond; /* acl condition to meet */
@ -62,8 +57,8 @@ struct act_rule {
int action;
} http;
struct {
struct sample_expr *expr;
struct cap_hdr *hdr;
struct sample_expr *expr; /* expression used as the key */
struct cap_hdr *hdr; /* the capture storage */
} cap;
struct {
struct sample_expr *expr;
@ -80,10 +75,6 @@ struct act_rule {
void *p[4];
} act; /* generic pointers to be used by custom actions */
} arg; /* arguments used by some actions */
union {
struct capture_prm cap;
} act_prm;
};
#endif /* _TYPES_ACTION_H */

View File

@ -8226,7 +8226,7 @@ out_uri_auth_compat:
if ((curproxy->cap & PR_CAP_FE) && !curproxy->tcp_req.inspect_delay) {
list_for_each_entry(trule, &curproxy->tcp_req.inspect_rules, list) {
if (trule->action == TCP_ACT_CAPTURE &&
!(trule->act_prm.cap.expr->fetch->val & SMP_VAL_FE_SES_ACC))
!(trule->arg.cap.expr->fetch->val & SMP_VAL_FE_SES_ACC))
break;
if ((trule->action >= TCP_ACT_TRK_SC0 && trule->action <= TCP_ACT_TRK_SCMAX) &&
!(trule->arg.trk_ctr.expr->fetch->val & SMP_VAL_FE_SES_ACC))

View File

@ -1205,11 +1205,11 @@ resume_execution:
}
else if (rule->action == TCP_ACT_CAPTURE) {
struct sample *key;
struct cap_hdr *h = rule->act_prm.cap.hdr;
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 | partial, rule->act_prm.cap.expr, SMP_T_STR);
key = sample_fetch_as_type(s->be, sess, s, SMP_OPT_DIR_REQ | partial, rule->arg.cap.expr, SMP_T_STR);
if (!key)
continue;
@ -1615,8 +1615,8 @@ static int tcp_parse_request_rule(char **args, int arg, int section_type,
/* check if we need to allocate an hdr_idx struct for HTTP parsing */
curpx->http_needed |= !!(expr->fetch->use & SMP_USE_HTTP_ANY);
rule->act_prm.cap.expr = expr;
rule->act_prm.cap.hdr = hdr;
rule->arg.cap.expr = expr;
rule->arg.cap.hdr = hdr;
rule->action = TCP_ACT_CAPTURE;
}
else if (strncmp(args[arg], "track-sc", 8) == 0 &&