MINOR: proxy: Remove the unused list of block rules
The keyword "block" is now unsupported. So the list of block rules is now
unused. It can be safely removed from the structure proxy.
diff --git a/include/types/proxy.h b/include/types/proxy.h
index 86788a1..a57b073 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -312,7 +312,6 @@
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) */
diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c
index bb0764d..f324a63 100644
--- a/src/cfgparse-listen.c
+++ b/src/cfgparse-listen.c
@@ -66,19 +66,6 @@
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 @@
}
/* 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)
{
diff --git a/src/cfgparse.c b/src/cfgparse.c
index a58c33d..ecf62f9 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -2813,16 +2813,6 @@
}
}
- /* 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 @@
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);
diff --git a/src/proxy.c b/src/proxy.c
index de54f0b..eba6ec7 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -862,7 +862,6 @@
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);