mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-14 15:49:03 +02:00
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.
This commit is contained in:
@@ -52,7 +52,7 @@ int be_lastsession(const struct proxy *be);
|
||||
/* Returns number of usable servers in backend */
|
||||
static inline int be_usable_srv(struct proxy *be)
|
||||
{
|
||||
if (be->disabled)
|
||||
if (be->flags & (PR_FL_DISABLED|PR_FL_STOPPED))
|
||||
return 0;
|
||||
else if (be->srv_act)
|
||||
return be->srv_act;
|
||||
|
||||
@@ -200,9 +200,9 @@ enum PR_SRV_STATE_FILE {
|
||||
#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 */
|
||||
/* Proxy flags */
|
||||
#define PR_FL_DISABLED 0x01 /* The proxy was disabled in the configuration (not at runtime) */
|
||||
#define PR_FL_STOPPED 0x02 /* The proxy was stopped */
|
||||
|
||||
struct stream;
|
||||
|
||||
@@ -258,7 +258,7 @@ struct error_snapshot {
|
||||
|
||||
struct proxy {
|
||||
enum obj_type obj_type; /* object type == OBJ_TYPE_PROXY */
|
||||
char disabled; /* bit field PR_DISABLED | PR_STOPPED */
|
||||
char flags; /* bit field PR_FL_* */
|
||||
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 */
|
||||
|
||||
Reference in New Issue
Block a user