mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-19 13:35:47 +00:00
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:
parent
5ec63e008d
commit
d0d65aeab6
@ -24,11 +24,6 @@
|
|||||||
|
|
||||||
#include <types/stick_table.h>
|
#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 act_rule {
|
||||||
struct list list;
|
struct list list;
|
||||||
struct acl_cond *cond; /* acl condition to meet */
|
struct acl_cond *cond; /* acl condition to meet */
|
||||||
@ -62,8 +57,8 @@ struct act_rule {
|
|||||||
int action;
|
int action;
|
||||||
} http;
|
} http;
|
||||||
struct {
|
struct {
|
||||||
struct sample_expr *expr;
|
struct sample_expr *expr; /* expression used as the key */
|
||||||
struct cap_hdr *hdr;
|
struct cap_hdr *hdr; /* the capture storage */
|
||||||
} cap;
|
} cap;
|
||||||
struct {
|
struct {
|
||||||
struct sample_expr *expr;
|
struct sample_expr *expr;
|
||||||
@ -80,10 +75,6 @@ struct act_rule {
|
|||||||
void *p[4];
|
void *p[4];
|
||||||
} act; /* generic pointers to be used by custom actions */
|
} act; /* generic pointers to be used by custom actions */
|
||||||
} arg; /* arguments used by some actions */
|
} arg; /* arguments used by some actions */
|
||||||
|
|
||||||
union {
|
|
||||||
struct capture_prm cap;
|
|
||||||
} act_prm;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _TYPES_ACTION_H */
|
#endif /* _TYPES_ACTION_H */
|
||||||
|
@ -8226,7 +8226,7 @@ out_uri_auth_compat:
|
|||||||
if ((curproxy->cap & PR_CAP_FE) && !curproxy->tcp_req.inspect_delay) {
|
if ((curproxy->cap & PR_CAP_FE) && !curproxy->tcp_req.inspect_delay) {
|
||||||
list_for_each_entry(trule, &curproxy->tcp_req.inspect_rules, list) {
|
list_for_each_entry(trule, &curproxy->tcp_req.inspect_rules, list) {
|
||||||
if (trule->action == TCP_ACT_CAPTURE &&
|
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;
|
break;
|
||||||
if ((trule->action >= TCP_ACT_TRK_SC0 && trule->action <= TCP_ACT_TRK_SCMAX) &&
|
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))
|
!(trule->arg.trk_ctr.expr->fetch->val & SMP_VAL_FE_SES_ACC))
|
||||||
|
@ -1205,11 +1205,11 @@ resume_execution:
|
|||||||
}
|
}
|
||||||
else if (rule->action == TCP_ACT_CAPTURE) {
|
else if (rule->action == TCP_ACT_CAPTURE) {
|
||||||
struct sample *key;
|
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;
|
char **cap = s->req_cap;
|
||||||
int len;
|
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)
|
if (!key)
|
||||||
continue;
|
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 */
|
/* check if we need to allocate an hdr_idx struct for HTTP parsing */
|
||||||
curpx->http_needed |= !!(expr->fetch->use & SMP_USE_HTTP_ANY);
|
curpx->http_needed |= !!(expr->fetch->use & SMP_USE_HTTP_ANY);
|
||||||
|
|
||||||
rule->act_prm.cap.expr = expr;
|
rule->arg.cap.expr = expr;
|
||||||
rule->act_prm.cap.hdr = hdr;
|
rule->arg.cap.hdr = hdr;
|
||||||
rule->action = TCP_ACT_CAPTURE;
|
rule->action = TCP_ACT_CAPTURE;
|
||||||
}
|
}
|
||||||
else if (strncmp(args[arg], "track-sc", 8) == 0 &&
|
else if (strncmp(args[arg], "track-sc", 8) == 0 &&
|
||||||
|
Loading…
Reference in New Issue
Block a user