struct act_rule *rule;
struct hdr_ctx ctx;
const char *auth_realm;
- int final;
+ int act_flags = 0;
/* If "the current_rule_list" match the executed rule list, we are in
* resume condition. If a resume is needed it is always in the action
continue;
}
+ act_flags |= ACT_FLAG_FIRST;
resume_execution:
switch (rule->action) {
case ACT_ACTION_ALLOW:
}
case ACT_CUSTOM:
- final = 0;
- if (px->options & PR_O_ABRT_CLOSE)
- final = (s->req.flags & (CF_SHUTR|CF_READ_NULL|CF_READ_ERROR));
+ if ((px->options & PR_O_ABRT_CLOSE) && (s->req.flags & (CF_SHUTR|CF_READ_NULL|CF_READ_ERROR)))
+ act_flags |= ACT_FLAG_FINAL;
- switch (rule->action_ptr(rule, px, s->sess, s, final)) {
+ switch (rule->action_ptr(rule, px, s->sess, s, act_flags)) {
case ACT_RET_ERR:
case ACT_RET_CONT:
break;
struct connection *cli_conn;
struct act_rule *rule;
struct hdr_ctx ctx;
- int final;
+ int act_flags = 0;
/* If "the current_rule_list" match the executed rule list, we are in
* resume condition. If a resume is needed it is always in the action
continue;
}
+ act_flags |= ACT_FLAG_FIRST;
resume_execution:
switch (rule->action) {
case ACT_ACTION_ALLOW:
return HTTP_RULE_RES_DONE;
case ACT_CUSTOM:
- final = 0;
- if (px->options & PR_O_ABRT_CLOSE)
- final = (s->req.flags & (CF_SHUTR|CF_READ_NULL|CF_READ_ERROR));
+ if ((px->options & PR_O_ABRT_CLOSE) && (s->req.flags & (CF_SHUTR|CF_READ_NULL|CF_READ_ERROR)))
+ act_flags |= ACT_FLAG_FINAL;
- switch (rule->action_ptr(rule, px, s->sess, s, final)) {
+ switch (rule->action_ptr(rule, px, s->sess, s, act_flags)) {
case ACT_RET_ERR:
case ACT_RET_CONT:
break;
struct stksess *ts;
struct stktable *t;
int partial;
+ int act_flags = 0;
DPRINTF(stderr,"[%u] %s: stream=%p b=%p, exp(r,w)=%u,%u bf=%08x bh=%d analysers=%02x\n",
now_ms, __FUNCTION__,
}
if (ret) {
+ act_flags |= ACT_FLAG_FIRST;
resume_execution:
/* we have a matching rule. */
if (rule->action == ACT_ACTION_ALLOW) {
if (!rule->action_ptr)
continue;
- switch (rule->action_ptr(rule, s->be, s->sess, s, (partial & SMP_OPT_FINAL) ? ACT_FLAG_FINAL : 0)) {
+ if (partial & SMP_OPT_FINAL)
+ act_flags |= ACT_FLAG_FINAL;
+
+ switch (rule->action_ptr(rule, s->be, s->sess, s, act_flags)) {
case ACT_RET_ERR:
case ACT_RET_CONT:
continue;
struct session *sess = s->sess;
struct act_rule *rule;
int partial;
+ int act_flags = 0;
DPRINTF(stderr,"[%u] %s: stream=%p b=%p, exp(r,w)=%u,%u bf=%08x bh=%d analysers=%02x\n",
now_ms, __FUNCTION__,
}
if (ret) {
+ act_flags |= ACT_FLAG_FIRST;
resume_execution:
/* we have a matching rule. */
if (rule->action == ACT_ACTION_ALLOW) {
/* Custom keywords. */
if (!rule->action_ptr)
continue;
- switch (rule->action_ptr(rule, s->be, s->sess, s, (partial & SMP_OPT_FINAL) ? ACT_FLAG_FINAL : 0)) {
+
+ if (partial & SMP_OPT_FINAL)
+ act_flags |= ACT_FLAG_FINAL;
+
+ switch (rule->action_ptr(rule, s->be, s->sess, s, act_flags)) {
case ACT_RET_ERR:
case ACT_RET_CONT:
continue;
/* Custom keywords. */
if (rule->action_ptr)
break;
- switch (rule->action_ptr(rule, sess->fe, sess, NULL, ACT_FLAG_FINAL)) {
+ switch (rule->action_ptr(rule, sess->fe, sess, NULL, ACT_FLAG_FINAL | ACT_FLAG_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.