MINOR: action: add reference to the original keywork matched for the called parser.
This is usefull because the keyword can contains some condifiguration
data set while the keyword registration.
diff --git a/include/types/action.h b/include/types/action.h
index d74e5ba..b7e1063 100644
--- a/include/types/action.h
+++ b/include/types/action.h
@@ -93,6 +93,7 @@
short deny_status; /* HTTP status to return to user when denying */
enum act_return (*action_ptr)(struct act_rule *rule, struct proxy *px,
struct session *sess, struct stream *s); /* ptr to custom action */
+ struct action_kw *kw;
union {
struct {
char *realm;
diff --git a/src/proto_http.c b/src/proto_http.c
index 57cc354..9acf0a2 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -9442,6 +9442,7 @@
cur_arg = 1;
/* try in the module list */
rule->from = ACT_F_HTTP_REQ;
+ rule->kw = custom;
if (custom->parse(args, &cur_arg, proxy, rule, &errmsg) == ACT_RET_PRS_ERR) {
Alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-request %s' rule : %s.\n",
file, linenum, proxy_type_str(proxy), proxy->id, args[0], errmsg);
@@ -9798,6 +9799,7 @@
cur_arg = 1;
/* try in the module list */
rule->from = ACT_F_HTTP_RES;
+ rule->kw = custom;
if (custom->parse(args, &cur_arg, proxy, rule, &errmsg) == ACT_RET_PRS_ERR) {
Alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-response %s' rule : %s.\n",
file, linenum, proxy_type_str(proxy), proxy->id, args[0], errmsg);
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index e671e41..2ea7161 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -1435,6 +1435,7 @@
if (kw) {
arg++;
rule->from = ACT_F_TCP_RES_CNT;
+ rule->kw = kw;
if (kw->parse((const char **)args, &arg, curpx, rule, err) == ACT_RET_PRS_ERR)
return -1;
} else {
@@ -1636,9 +1637,11 @@
struct action_kw *kw;
if (where & SMP_VAL_FE_CON_ACC) {
kw = tcp_req_conn_action(args[arg]);
+ rule->kw = kw;
rule->from = ACT_F_TCP_REQ_CON;
} else {
kw = tcp_req_cont_action(args[arg]);
+ rule->kw = kw;
rule->from = ACT_F_TCP_REQ_CNT;
}
if (kw) {