CLEANUP: proxy: rename "block_cond" to "block_rules"

Next patch will make them real rules, not only conditions. This separate
patch makes the next one more readable.
This commit is contained in:
Willy Tarreau 2014-04-28 22:05:31 +02:00
parent 5bd6759a19
commit 353bc9f43f
5 changed files with 6 additions and 6 deletions

View 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) */

View 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")) {

View 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);

View 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);

View 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);