MINOR: action: Add the return code ACT_RET_DONE for actions
This code should be now used by action to stop at the same time the rules
processing and the possible following processings. And from its side, the return
code ACT_RET_STOP should be used to only stop rules processing.
So concretely, for TCP rules, there is no changes. ACT_RET_STOP and ACT_RET_DONE
are handled the same way. However, for HTTP rules, ACT_RET_STOP should now be
mapped on HTTP_RULE_RES_STOP and ACT_RET_DONE on HTTP_RULE_RES_DONE. So this
way, a action will have the possibilty to stop all processing or only rules
processing.
Note that changes about the TCP is done in this commit but changes about the
HTTP will be done in another one because it will fix a bug in the same time.
This patch must be backported to 2.0 because a bugfix depends on it.
diff --git a/src/tcp_rules.c b/src/tcp_rules.c
index 72b11ae..d81ffe3 100644
--- a/src/tcp_rules.c
+++ b/src/tcp_rules.c
@@ -242,12 +242,13 @@
case ACT_RET_CONT:
continue;
case ACT_RET_STOP:
+ case ACT_RET_DONE:
break;
case ACT_RET_YIELD:
s->current_rule = rule;
goto missing_data;
}
- break; /* ACT_RET_STOP */
+ break; /* ACT_RET_STOP/DONE */
}
}
}
@@ -379,13 +380,14 @@
case ACT_RET_CONT:
continue;
case ACT_RET_STOP:
+ case ACT_RET_DONE:
break;
case ACT_RET_YIELD:
channel_dont_close(rep);
s->current_rule = rule;
return 0;
}
- break; /* ACT_RET_STOP */
+ break; /* ACT_RET_STOP/DONE */
}
}
}
@@ -484,6 +486,7 @@
send_log(sess->fe, LOG_WARNING,
"Internal error: yield not allowed with tcp-request connection actions.");
case ACT_RET_STOP:
+ case ACT_RET_DONE:
break;
case ACT_RET_CONT:
continue;
@@ -491,7 +494,7 @@
result = 0;
break;
}
- break; /* ACT_RET_STOP */
+ break; /* ACT_RET_STOP/DONE */
}
}
}
@@ -563,6 +566,7 @@
send_log(sess->fe, LOG_WARNING,
"Internal error: yield not allowed with tcp-request session actions.");
case ACT_RET_STOP:
+ case ACT_RET_DONE:
break;
case ACT_RET_CONT:
continue;
@@ -570,7 +574,7 @@
result = 0;
break;
}
- break; /* ACT_RET_STOP */
+ break; /* ACT_RET_STOP/DONE */
}
}
}