]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: actions: remove the mark indicating the last entry in enum
authorThierry FOURNIER <tfournier@arpalert.org>
Wed, 5 Aug 2015 17:13:48 +0000 (19:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Aug 2015 15:13:47 +0000 (17:13 +0200)
This mark permit to detect if the action tag is over the allowed range.
 - Normally, this case doesn't appear
 - If it appears, it is processed by ded fault case of the switch

include/types/proto_http.h
src/proto_http.c

index 563d02d40ae7ffe4e96d5c1de823a66339b260b7..62016da08c1ea1784429cb9990aa2307e6defb28 100644 (file)
@@ -252,7 +252,6 @@ enum {
        HTTP_REQ_ACT_TRK_SC0,
        /* SC1, SC2, ... SCn */
        HTTP_REQ_ACT_TRK_SCMAX = HTTP_REQ_ACT_TRK_SC0 + MAX_SESS_STKCTR - 1,
-       HTTP_REQ_ACT_MAX /* must always be last */
 };
 
 /* actions for "http-response" */
@@ -276,7 +275,6 @@ enum {
        HTTP_RES_ACT_REDIR,
        HTTP_RES_ACT_CUSTOM_STOP,  /* used for module keywords */
        HTTP_RES_ACT_CUSTOM_CONT,  /* used for module keywords */
-       HTTP_RES_ACT_MAX /* must always be last */
 };
 
 /* final results for http-request rules */
index 6571fdaef79df1e8b7715bac142c68abd69918a8..0d8f50cf9b6f78eaf3397c18b0b5f258b8122a66 100644 (file)
@@ -3432,8 +3432,6 @@ http_req_get_intercept_rule(struct proxy *px, struct list *rules, struct stream
        s->current_rule_list = rules;
 
        list_for_each_entry(rule, rules, list) {
-               if (rule->action >= HTTP_REQ_ACT_MAX)
-                       continue;
 
                /* check optional condition */
                if (rule->cond) {
@@ -3694,6 +3692,10 @@ resume_execution:
                                }
                        }
                        break;
+
+               /* other flags exists, but normaly, they never be matched. */
+               default:
+                       break;
                }
        }
 
@@ -3735,8 +3737,6 @@ http_res_get_intercept_rule(struct proxy *px, struct list *rules, struct stream
        s->current_rule_list = rules;
 
        list_for_each_entry(rule, rules, list) {
-               if (rule->action >= HTTP_RES_ACT_MAX)
-                       continue;
 
                /* check optional condition */
                if (rule->cond) {
@@ -3918,6 +3918,10 @@ resume_execution:
                case HTTP_RES_ACT_CUSTOM_STOP:
                        rule->action_ptr(rule, px, s->sess, s);
                        return HTTP_RULE_RES_STOP;
+
+               /* other flags exists, but normaly, they never be matched. */
+               default:
+                       break;
                }
        }