]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: Remove the unused list of block rules
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 17 Jul 2019 13:19:51 +0000 (15:19 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 19 Jul 2019 07:24:12 +0000 (09:24 +0200)
The keyword "block" is now unsupported. So the list of block rules is now
unused. It can be safely removed from the structure proxy.

include/types/proxy.h
src/cfgparse-listen.c
src/cfgparse.c
src/proxy.c

index 86788a1e6e3baae973f1ec600c69a85ee5ee67fd..a57b0739dba47943f39af8b11c564435185e5d88 100644 (file)
@@ -312,7 +312,6 @@ struct proxy {
        struct list acl;                        /* ACL declared on this proxy */
        struct list http_req_rules;             /* HTTP request rules: allow/deny/... */
        struct list http_res_rules;             /* HTTP response rules: allow/deny/... */
-       struct list block_rules;                /* http-request block rules to be inserted before other ones */
        struct list redirect_rules;             /* content redirecting rules (chained) */
        struct list switching_rules;            /* content switching rules (chained) */
        struct list persist_rules;              /* 'force-persist' and 'ignore-persist' rules (chained) */
index bb0764d11359784bdbf594d615f07daee9b57110..f324a636f2cc6e722e531c27d662c40ef55f9ac9 100644 (file)
@@ -66,19 +66,6 @@ int warnif_rule_after_monitor(struct proxy *proxy, const char *file, int line, c
        return 0;
 }
 
-/* Report a warning if a rule is placed after a 'block' rule.
- * Return 1 if the warning has been emitted, otherwise 0.
- */
-int warnif_rule_after_block(struct proxy *proxy, const char *file, int line, const char *arg)
-{
-       if (!LIST_ISEMPTY(&proxy->block_rules)) {
-               ha_warning("parsing [%s:%d] : a '%s' rule placed after a 'block' rule will still be processed before.\n",
-                          file, line, arg);
-               return 1;
-       }
-       return 0;
-}
-
 /* Report a warning if a rule is placed after an 'http_request' rule.
  * Return 1 if the warning has been emitted, otherwise 0.
  */
@@ -186,19 +173,12 @@ int warnif_misplaced_http_req(struct proxy *proxy, const char *file, int line, c
 }
 
 /* report a warning if a block rule is dangerously placed */
-int warnif_misplaced_block(struct proxy *proxy, const char *file, int line, const char *arg)
+int warnif_misplaced_monitor(struct proxy *proxy, const char *file, int line, const char *arg)
 {
        return  warnif_rule_after_http_req(proxy, file, line, arg) ||
                warnif_misplaced_http_req(proxy, file, line, arg);
 }
 
-/* report a warning if a block rule is dangerously placed */
-int warnif_misplaced_monitor(struct proxy *proxy, const char *file, int line, const char *arg)
-{
-       return  warnif_rule_after_block(proxy, file, line, arg) ||
-               warnif_misplaced_block(proxy, file, line, arg);
-}
-
 /* report a warning if a "tcp request content" rule is dangerously placed */
 int warnif_misplaced_tcp_cont(struct proxy *proxy, const char *file, int line, const char *arg)
 {
index a58c33d3cfbce41aa556dff0d7d388209bf52a89..ecf62f997c688f70de40c0142b77ff104380961c 100644 (file)
@@ -2813,16 +2813,6 @@ int check_config_validity()
                        }
                }
 
-               /* move any "block" rules at the beginning of the http-request rules */
-               if (!LIST_ISEMPTY(&curproxy->block_rules)) {
-                       /* insert block_rules into http_req_rules at the beginning */
-                       curproxy->block_rules.p->n    = curproxy->http_req_rules.n;
-                       curproxy->http_req_rules.n->p = curproxy->block_rules.p;
-                       curproxy->block_rules.n->p    = &curproxy->http_req_rules;
-                       curproxy->http_req_rules.n    = curproxy->block_rules.n;
-                       LIST_INIT(&curproxy->block_rules);
-               }
-
                if (curproxy->table && curproxy->table->peers.name) {
                        struct peers *curpeers;
 
@@ -3374,12 +3364,6 @@ out_uri_auth_compat:
                                err_code |= ERR_WARN;
                        }
 
-                       if (!LIST_ISEMPTY(&curproxy->block_rules)) {
-                               ha_warning("config : 'block' rules ignored for %s '%s' as they require HTTP mode.\n",
-                                          proxy_type_str(curproxy), curproxy->id);
-                               err_code |= ERR_WARN;
-                       }
-
                        if (!LIST_ISEMPTY(&curproxy->redirect_rules)) {
                                ha_warning("config : 'redirect' rules ignored for %s '%s' as they require HTTP mode.\n",
                                           proxy_type_str(curproxy), curproxy->id);
index de54f0b806c9648c84be0791151631a22d05d33f..eba6ec765b10a0166e9e666d9d36fc403643ceb8 100644 (file)
@@ -862,7 +862,6 @@ void init_new_proxy(struct proxy *p)
        LIST_INIT(&p->acl);
        LIST_INIT(&p->http_req_rules);
        LIST_INIT(&p->http_res_rules);
-       LIST_INIT(&p->block_rules);
        LIST_INIT(&p->redirect_rules);
        LIST_INIT(&p->mon_fail_cond);
        LIST_INIT(&p->switching_rules);