From: Willy Tarreau Date: Mon, 23 Jan 2017 20:38:57 +0000 (+0100) Subject: MINOR: server: extend the flags to 32 bits X-Git-Tag: v1.8-dev1~147 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0752565fe13fb040a5437f6c326a6f78a3b9d2b;p=thirdparty%2Fhaproxy.git MINOR: server: extend the flags to 32 bits Right now not only we're limited to 8 bits, but it's mentionned nowhere and the limit was already reached. In addition, pp_opts (proxy protocol options) were set to 32 bits while only 3 are needed. So let's swap these two and group them together to avoid leaving two holes in the structure, saving 64 bits on 64-bit machines. --- diff --git a/include/types/server.h b/include/types/server.h index 8a6f72f778..51b7e535c6 100644 --- a/include/types/server.h +++ b/include/types/server.h @@ -108,7 +108,7 @@ enum srv_initaddr { #define SRV_STATE_FILE_NB_FIELDS_VERSION_1 18 #define SRV_STATE_LINE_MAXLEN 512 -/* server flags */ +/* server flags -- 32 bits */ #define SRV_F_BACKUP 0x0001 /* this server is a backup server */ #define SRV_F_MAPPORTS 0x0002 /* this server uses mapped ports */ #define SRV_F_NON_STICK 0x0004 /* never add connections allocated to this server to a stick table */ @@ -177,13 +177,13 @@ struct server { enum obj_type obj_type; /* object type == OBJ_TYPE_SERVER */ enum srv_state state, prev_state; /* server state among SRV_ST_* */ enum srv_admin admin, prev_admin; /* server maintenance status : SRV_ADMF_* */ - unsigned char flags; /* server flags (SRV_F_*) */ + unsigned char pp_opts; /* proxy protocol options (SRV_PP_*) */ + unsigned int flags; /* server flags (SRV_F_*) */ struct server *next; int cklen; /* the len of the cookie, to speed up checks */ int rdr_len; /* the length of the redirection prefix */ char *cookie; /* the id set in the cookie */ char *rdr_pfx; /* the redirection prefix */ - int pp_opts; /* proxy protocol options (SRV_PP_*) */ struct proxy *proxy; /* the proxy this server belongs to */ int served; /* # of active sessions currently being served (ie not pending) */