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
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;
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,
}
/* 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)) {
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);
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;
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:
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);
continue;
}
- act_flags |= ACT_FLAG_FIRST;
+ act_opts |= ACT_OPT_FIRST;
resume_execution:
/* Always call the action function if defined */
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:
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))))
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);
}
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:
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);
}
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:
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.
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.