MEDIUM: action: add a new flag ACT_FLAG_FIRST

This flag is used by custom actions to know that they're called for the
first time. The only case where it's not set is when they're resuming
from a yield. It will be needed to let them know when they have to
allocate some resources.
diff --git a/src/proto_http.c b/src/proto_http.c
index e646f79..41858bf 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -3497,7 +3497,7 @@
 	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
@@ -3528,6 +3528,7 @@
 				continue;
 		}
 
+		act_flags |= ACT_FLAG_FIRST;
 resume_execution:
 		switch (rule->action) {
 		case ACT_ACTION_ALLOW:
@@ -3710,11 +3711,10 @@
 			}
 
 		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;
@@ -3809,7 +3809,7 @@
 	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
@@ -3840,6 +3840,7 @@
 				continue;
 		}
 
+		act_flags |= ACT_FLAG_FIRST;
 resume_execution:
 		switch (rule->action) {
 		case ACT_ACTION_ALLOW:
@@ -3997,11 +3998,10 @@
 			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;