CLEANUP: remove last references to 'ruleset' section

This commit is contained in:
Christopher Faulet 2016-10-26 11:06:28 +02:00 committed by Willy Tarreau
parent 0099a8ca9d
commit 898566e7e6
4 changed files with 7 additions and 11 deletions

View File

@ -91,7 +91,6 @@ static inline int warnifnotcap(struct proxy *proxy, int cap, const char *file, i
switch (cap) {
case PR_CAP_BE: msg = "no backend"; break;
case PR_CAP_FE: msg = "no frontend"; break;
case PR_CAP_RS: msg = "no ruleset"; break;
case PR_CAP_BE|PR_CAP_FE: msg = "neither frontend nor backend"; break;
default: msg = "not enough"; break;
}

View File

@ -77,8 +77,7 @@ enum PR_SRV_STATE_FILE {
#define PR_CAP_NONE 0x0000
#define PR_CAP_FE 0x0001
#define PR_CAP_BE 0x0002
#define PR_CAP_RS 0x0004
#define PR_CAP_LISTEN (PR_CAP_FE|PR_CAP_BE|PR_CAP_RS)
#define PR_CAP_LISTEN (PR_CAP_FE|PR_CAP_BE)
/* bits for proxy->options */
#define PR_O_REDISP 0x00000001 /* allow reconnection to dispatch in case of errors */

View File

@ -2040,7 +2040,7 @@ static int create_cond_regex_rule(const char *file, int line,
goto err;
}
if (warnifnotcap(px, PR_CAP_RS, file, line, cmd, NULL))
if (warnifnotcap(px, PR_CAP_FE | PR_CAP_BE, file, line, cmd, NULL))
ret_code |= ERR_WARN;
if (cond_start &&
@ -2743,9 +2743,9 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
if (!strcmp(args[0], "listen"))
rc = PR_CAP_LISTEN;
else if (!strcmp(args[0], "frontend"))
rc = PR_CAP_FE | PR_CAP_RS;
rc = PR_CAP_FE;
else if (!strcmp(args[0], "backend"))
rc = PR_CAP_BE | PR_CAP_RS;
rc = PR_CAP_BE;
else
rc = PR_CAP_NONE;
@ -6502,7 +6502,7 @@ stats_error_parsing:
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
else if (warnifnotcap(curproxy, PR_CAP_RS, file, linenum, args[0], NULL))
else if (warnifnotcap(curproxy, PR_CAP_FE | PR_CAP_BE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
if (*(args[1]) == 0) {
@ -6599,7 +6599,7 @@ stats_error_parsing:
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
else if (warnifnotcap(curproxy, PR_CAP_RS, file, linenum, args[0], NULL))
else if (warnifnotcap(curproxy, PR_CAP_FE | PR_CAP_BE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
if (*(args[1]) == 0) {

View File

@ -56,7 +56,7 @@ unsigned int error_snapshot_id = 0; /* global ID assigned to each error then
/*
* This function returns a string containing a name describing capabilities to
* report comprehensible error messages. Specifically, it will return the words
* "frontend", "backend", "ruleset" when appropriate, or "proxy" for all other
* "frontend", "backend" when appropriate, or "proxy" for all other
* cases including the proxies declared in "listen" mode.
*/
const char *proxy_cap_str(int cap)
@ -66,8 +66,6 @@ const char *proxy_cap_str(int cap)
return "frontend";
else if (cap & PR_CAP_BE)
return "backend";
else if (cap & PR_CAP_RS)
return "ruleset";
}
return "proxy";
}