MINOR: actions: Rename the act_flag enum into act_opt
The flags in the act_flag enum have been renamed act_opt. It means ACT_OPT
prefix is used instead of ACT_FLAG. The purpose of this patch is to reserve the
action flags for the actions configuration.
diff --git a/include/types/action.h b/include/types/action.h
index 5b4ede7..d13a549 100644
--- a/include/types/action.h
+++ b/include/types/action.h
@@ -52,11 +52,11 @@
ACT_RET_PRS_ERR, /* abort processing. */
};
-/* flags passed to custom actions */
-enum act_flag {
- ACT_FLAG_NONE = 0x00000000, /* no flag */
- ACT_FLAG_FINAL = 0x00000001, /* last call, cannot yield */
- ACT_FLAG_FIRST = 0x00000002, /* first call for this action */
+/* Option flags passed to custom actions */
+enum act_opt {
+ ACT_OPT_NONE = 0x00000000, /* no flag */
+ ACT_OPT_FINAL = 0x00000001, /* last call, cannot yield */
+ ACT_OPT_FIRST = 0x00000002, /* first call for this action */
};
/* known actions to be used without any action function pointer. This enum is
@@ -112,7 +112,7 @@
enum act_name action; /* ACT_ACTION_* */
enum act_from from; /* ACT_F_* */
enum act_return (*action_ptr)(struct act_rule *rule, struct proxy *px, /* ptr to custom action */
- struct session *sess, struct stream *s, int flags);
+ struct session *sess, struct stream *s, int opts);
int (*check_ptr)(struct act_rule *rule, struct proxy *px, char **err); /* ptr to check function */
void (*release_ptr)(struct act_rule *rule); /* ptr to release function */
struct action_kw *kw;
diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index d458f19..e3328cc 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -4538,7 +4538,7 @@
if (ret == 1)
return ACT_RET_CONT;
else if (ret == 0) {
- if (flags & ACT_FLAG_FINAL) {
+ if (flags & ACT_OPT_FINAL) {
SPOE_PRINTF(stderr, "%d.%06d [SPOE/%-15s] %s: stream=%p"
" - failed to process group '%s': interrupted by caller\n",
(int)now.tv_sec, (int)now.tv_usec,
diff --git a/src/hlua.c b/src/hlua.c
index ee36cd9..694b3ff 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -6221,7 +6221,7 @@
}
/* Execute the function. */
- switch (hlua_ctx_resume(s->hlua, !(flags & ACT_FLAG_FINAL))) {
+ switch (hlua_ctx_resume(s->hlua, !(flags & ACT_OPT_FINAL))) {
/* finished. */
case HLUA_E_OK:
if (!consistency_check(s, dir, &s->hlua->cons)) {
diff --git a/src/http_ana.c b/src/http_ana.c
index 7f14c4b..171ddfd 100644
--- a/src/http_ana.c
+++ b/src/http_ana.c
@@ -2927,7 +2927,7 @@
struct http_hdr_ctx ctx;
const char *auth_realm;
enum rule_result rule_ret = HTTP_RULE_RES_CONT;
- int act_flags = 0;
+ int act_opts = 0;
int early_hints = 0;
htx = htxbuf(&s->req.buf);
@@ -2963,7 +2963,7 @@
continue;
}
- act_flags |= ACT_FLAG_FIRST;
+ act_opts |= ACT_OPT_FIRST;
resume_execution:
if (early_hints && rule->action != ACT_HTTP_EARLY_HINT) {
early_hints = 0;
@@ -2978,9 +2978,9 @@
if ((s->req.flags & CF_READ_ERROR) ||
((s->req.flags & (CF_SHUTR|CF_READ_NULL)) &&
(px->options & PR_O_ABRT_CLOSE)))
- act_flags |= ACT_FLAG_FINAL;
+ act_opts |= ACT_OPT_FINAL;
- switch (rule->action_ptr(rule, px, sess, s, act_flags)) {
+ switch (rule->action_ptr(rule, px, sess, s, act_opts)) {
case ACT_RET_CONT:
break;
case ACT_RET_STOP:
@@ -3341,7 +3341,7 @@
struct act_rule *rule;
struct http_hdr_ctx ctx;
enum rule_result rule_ret = HTTP_RULE_RES_CONT;
- int act_flags = 0;
+ int act_opts = 0;
htx = htxbuf(&s->res.buf);
@@ -3376,7 +3376,7 @@
continue;
}
- act_flags |= ACT_FLAG_FIRST;
+ act_opts |= ACT_OPT_FIRST;
resume_execution:
/* Always call the action function if defined */
@@ -3384,9 +3384,9 @@
if ((s->req.flags & CF_READ_ERROR) ||
((s->req.flags & (CF_SHUTR|CF_READ_NULL)) &&
(px->options & PR_O_ABRT_CLOSE)))
- act_flags |= ACT_FLAG_FINAL;
+ act_opts |= ACT_OPT_FINAL;
- switch (rule->action_ptr(rule, px, sess, s, act_flags)) {
+ switch (rule->action_ptr(rule, px, sess, s, act_opts)) {
case ACT_RET_CONT:
break;
case ACT_RET_STOP:
diff --git a/src/stream.c b/src/stream.c
index d16def5..941e98e 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -987,7 +987,7 @@
struct appctx *appctx;
/* Initialises the applet if it is required. */
- if (flags & ACT_FLAG_FIRST) {
+ if (flags & ACT_OPT_FIRST) {
/* Register applet. this function schedules the applet. */
s->target = &rule->applet.obj_type;
if (unlikely(!si_register_handler(&s->si[1], objt_applet(s->target))))
diff --git a/src/tcp_rules.c b/src/tcp_rules.c
index 988c8e9..ebf4e05 100644
--- a/src/tcp_rules.c
+++ b/src/tcp_rules.c
@@ -104,7 +104,7 @@
struct stksess *ts;
struct stktable *t;
int partial;
- int act_flags = 0;
+ int act_opts = 0;
DBG_TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s);
@@ -151,15 +151,15 @@
}
if (ret) {
- act_flags |= ACT_FLAG_FIRST;
+ act_opts |= ACT_OPT_FIRST;
resume_execution:
/* Always call the action function if defined */
if (rule->action_ptr) {
if (partial & SMP_OPT_FINAL)
- act_flags |= ACT_FLAG_FINAL;
+ act_opts |= ACT_OPT_FINAL;
- switch (rule->action_ptr(rule, s->be, s->sess, s, act_flags)) {
+ switch (rule->action_ptr(rule, s->be, s->sess, s, act_opts)) {
case ACT_RET_CONT:
break;
case ACT_RET_STOP:
@@ -303,7 +303,7 @@
struct session *sess = s->sess;
struct act_rule *rule;
int partial;
- int act_flags = 0;
+ int act_opts = 0;
DBG_TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s);
@@ -354,14 +354,14 @@
}
if (ret) {
- act_flags |= ACT_FLAG_FIRST;
+ act_opts |= ACT_OPT_FIRST;
resume_execution:
/* Always call the action function if defined */
if (rule->action_ptr) {
if (partial & SMP_OPT_FINAL)
- act_flags |= ACT_FLAG_FINAL;
+ act_opts |= ACT_OPT_FINAL;
- switch (rule->action_ptr(rule, s->be, s->sess, s, act_flags)) {
+ switch (rule->action_ptr(rule, s->be, s->sess, s, act_opts)) {
case ACT_RET_CONT:
break;
case ACT_RET_STOP:
@@ -486,7 +486,7 @@
if (ret) {
/* Always call the action function if defined */
if (rule->action_ptr) {
- switch (rule->action_ptr(rule, sess->fe, sess, NULL, ACT_FLAG_FINAL | ACT_FLAG_FIRST)) {
+ switch (rule->action_ptr(rule, sess->fe, sess, NULL, ACT_OPT_FINAL | ACT_OPT_FIRST)) {
case ACT_RET_YIELD:
/* yield is not allowed at this point. If this return code is
* used it is a bug, so I prefer to abort the process.
@@ -588,7 +588,7 @@
if (ret) {
/* Always call the action function if defined */
if (rule->action_ptr) {
- switch (rule->action_ptr(rule, sess->fe, sess, NULL, ACT_FLAG_FINAL | ACT_FLAG_FIRST)) {
+ switch (rule->action_ptr(rule, sess->fe, sess, NULL, ACT_OPT_FINAL | ACT_OPT_FIRST)) {
case ACT_RET_YIELD:
/* yield is not allowed at this point. If this return code is
* used it is a bug, so I prefer to abort the process.