*/
#define PR_RE_EARLY_ERROR 0x00010000 /* Retry if we failed at sending early data */
#define PR_RE_JUNK_REQUEST 0x00020000 /* We received an incomplete or garbage response */
+
+/* disabled state */
+#define PR_DISABLED 0x1 /* The proxy was disabled in the configuration (not at runtime) */
+#define PR_STOPPED 0x2 /* The proxy was stopped */
+
struct stream;
struct http_snapshot {
struct proxy {
enum obj_type obj_type; /* object type == OBJ_TYPE_PROXY */
- char disabled; /* non-zero if disabled or shutdown */
+ char disabled; /* bit field PR_DISABLED | PR_STOPPED */
enum pr_mode mode; /* mode = PR_MODE_TCP, PR_MODE_HTTP, ... */
char cap; /* supported capabilities (PR_CAP_*) */
unsigned int maxconn; /* max # of active streams on the frontend */
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 = 1;
+ curproxy->disabled = PR_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))
stktables_list = t;
}
else if (strcmp(args[0], "disabled") == 0) { /* disables this peers section */
- curpeers->disabled = 1;
+ curpeers->disabled = PR_DISABLED;
}
else if (strcmp(args[0], "enabled") == 0) { /* enables this peers section (used to revert a disabled default) */
curpeers->disabled = 0;
}
/* if the proxy shouldn't be in the master, we stop it */
if (!listen_in_master)
- curproxy->disabled = 1;
+ curproxy->disabled = PR_DISABLED;
}
}
if (p->li_ready + p->li_paused > 0)
return;
- p->disabled = 1;
+ p->disabled = PR_STOPPED;
/* Note: syslog proxies use their own loggers so while it's somewhat OK
* to report them being stopped as a warning, we must not spam their log
if (!p->disabled && !p->li_ready) {
/* might be just a backend */
- p->disabled = 1;
+ p->disabled |= PR_STOPPED;
}
HA_RWLOCK_WRUNLOCK(PROXY_LOCK, &p->lock);