MINOR: proxy: define PR_CAP_LB

Add a new proxy capability for proxy with load-balancing capabilities.
This help to differentiate listen/frontend/backend with special proxies
such as peer proxies.
This commit is contained in:
Amaury Denoyelle 2021-05-07 15:12:20 +02:00
parent 86c1d0fddb
commit b979f59871
2 changed files with 4 additions and 3 deletions

View File

@ -69,6 +69,7 @@ enum PR_SRV_STATE_FILE {
#define PR_CAP_LISTEN (PR_CAP_FE|PR_CAP_BE)
#define PR_CAP_DEF 0x0004 /* defaults section */
#define PR_CAP_LUA 0x0008 /* internal proxy used by lua engine */
#define PR_CAP_LB 0x0010 /* load-balancing capabilities, i.e. listen/frontend/backend proxies */
/* bits for proxy->options */
#define PR_O_REDISP 0x00000001 /* allow reconnection to dispatch in case of errors */

View File

@ -223,11 +223,11 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
}
if (strcmp(args[0], "listen") == 0)
rc = PR_CAP_LISTEN;
rc = PR_CAP_LISTEN | PR_CAP_LB;
else if (strcmp(args[0], "frontend") == 0)
rc = PR_CAP_FE;
rc = PR_CAP_FE | PR_CAP_LB;
else if (strcmp(args[0], "backend") == 0)
rc = PR_CAP_BE;
rc = PR_CAP_BE | PR_CAP_LB;
else if (strcmp(args[0], "defaults") == 0) {
/* "defaults" must first delete the last no-name defaults if any */
proxy_destroy_defaults(proxy_find_by_name("", PR_CAP_DEF, 0));