]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: proxy: rename "block_cond" to "block_rules"
authorWilly Tarreau <w@1wt.eu>
Mon, 28 Apr 2014 20:05:31 +0000 (22:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 28 Apr 2014 20:05:31 +0000 (22:05 +0200)
Next patch will make them real rules, not only conditions. This separate
patch makes the next one more readable.

include/types/proxy.h
src/cfgparse.c
src/haproxy.c
src/proto_http.c
src/proxy.c

index 4c0c660e95c9fa9944eb244f9690e1a29b712533..cf277fdd77678da688dc6c64a7372570ac03e4d5 100644 (file)
@@ -228,7 +228,7 @@ 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_cond;                 /* early blocking conditions (chained) */
+       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 7a869e36c8eca16a83a91a2d462ef55742d13d11..923f2e477a2cacaef9c080f2f20014d69e51f84b 100644 (file)
@@ -312,7 +312,7 @@ int str2listener(char *str, struct proxy *curproxy, struct bind_conf *bind_conf,
  */
 int warnif_rule_after_block(struct proxy *proxy, const char *file, int line, const char *arg)
 {
-       if (!LIST_ISEMPTY(&proxy->block_cond)) {
+       if (!LIST_ISEMPTY(&proxy->block_rules)) {
                Warning("parsing [%s:%d] : a '%s' rule placed after a 'block' rule will still be processed before.\n",
                        file, line, arg);
                return 1;
@@ -2894,7 +2894,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                        goto out;
                }
 
-               LIST_ADDQ(&curproxy->block_cond, &cond->list);
+               LIST_ADDQ(&curproxy->block_rules, &cond->list);
                warnif_misplaced_block(curproxy, file, linenum, args[0]);
        }
        else if (!strcmp(args[0], "redirect")) {
index ed2ff21e3bea76f9da05220b06ee05f457863950..9e0f33fd7fda4ecf46319e30d99d0db3e7924f28 100644 (file)
@@ -1016,7 +1016,7 @@ void deinit(void)
                        free(cwl);
                }
 
-               list_for_each_entry_safe(cond, condb, &p->block_cond, list) {
+               list_for_each_entry_safe(cond, condb, &p->block_rules, list) {
                        LIST_DEL(&cond->list);
                        prune_acl_cond(cond);
                        free(cond);
index 875cedcd741a06c26d065381c3cdcfd049cc50ce..14b083580b2f712ef114733a71a7bb6b248dd34e 100644 (file)
@@ -3838,7 +3838,7 @@ int http_process_req_common(struct session *s, struct channel *req, int an_bit,
        session_inc_be_http_req_ctr(s);
 
        /* first check whether we have some ACLs set to block this request */
-       list_for_each_entry(cond, &px->block_cond, list) {
+       list_for_each_entry(cond, &px->block_rules, list) {
                int ret = acl_exec_cond(cond, px, s, txn, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
 
                ret = acl_pass(ret);
index c8b815e5b1d5983d9c5dbe1e835995d619671ba7..ee7ffd730558c8bc57f19f2f2f3016733b46b1e1 100644 (file)
@@ -506,7 +506,7 @@ 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_cond);
+       LIST_INIT(&p->block_rules);
        LIST_INIT(&p->redirect_rules);
        LIST_INIT(&p->mon_fail_cond);
        LIST_INIT(&p->switching_rules);