MINOR: proxy: Introduce proxy flags to replace disabled bitfield
This change is required to support TCP/HTTP rules in defaults sections. The
'disabled' bitfield in the proxy structure, used to know if a proxy is
disabled or stopped, is replaced a generic bitfield named 'flags'.
PR_DISABLED and PR_STOPPED flags are renamed to PR_FL_DISABLED and
PR_FL_STOPPED respectively. In addition, everywhere there is a test to know
if a proxy is disabled or stopped, there is now a bitwise AND operation on
PR_FL_DISABLED and/or PR_FL_STOPPED flags.
diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c
index 6f526d4..f6589d1 100644
--- a/src/cfgparse-listen.c
+++ b/src/cfgparse-listen.c
@@ -595,12 +595,12 @@
else if (strcmp(args[0], "disabled") == 0) { /* disables this proxy */
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
- curproxy->disabled |= PR_DISABLED;
+ curproxy->flags |= PR_FL_DISABLED;
}
else if (strcmp(args[0], "enabled") == 0) { /* enables this proxy (used to revert a disabled default) */
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
- curproxy->disabled = 0;
+ curproxy->flags &= ~PR_FL_DISABLED;
}
else if (strcmp(args[0], "bind-process") == 0) { /* enable this proxy only on some processes */
int cur_arg = 1;