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) */
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.
*/
}
/* 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)
{
}
}
- /* 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;
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);
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);