mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-10 03:02:28 +00:00
MINOR: server: move the use_ssl field out of the ifdef USE_OPENSSL
Having it in the ifdef complicates certain operations which require additional ifdefs just to access a member which could remain zero in non-ssl cases. Let's move it out, it will not even increase the struct size on 64-bit machines due to alignment.
This commit is contained in:
parent
795cdabb57
commit
141ad85d10
@ -249,8 +249,8 @@ struct server {
|
|||||||
struct sockaddr_storage init_addr; /* plain IP address specified on the init-addr line */
|
struct sockaddr_storage init_addr; /* plain IP address specified on the init-addr line */
|
||||||
unsigned int init_addr_methods; /* initial address setting, 3-bit per method, ends at 0, enough to store 10 entries */
|
unsigned int init_addr_methods; /* initial address setting, 3-bit per method, ends at 0, enough to store 10 entries */
|
||||||
|
|
||||||
#ifdef USE_OPENSSL
|
|
||||||
int use_ssl; /* ssl enabled */
|
int use_ssl; /* ssl enabled */
|
||||||
|
#ifdef USE_OPENSSL
|
||||||
struct {
|
struct {
|
||||||
SSL_CTX *ctx;
|
SSL_CTX *ctx;
|
||||||
SSL_SESSION *reused_sess;
|
SSL_SESSION *reused_sess;
|
||||||
|
@ -3427,9 +3427,7 @@ int srv_check_healthcheck_port(struct check *chk)
|
|||||||
* default, unless one is specified.
|
* default, unless one is specified.
|
||||||
*/
|
*/
|
||||||
if (!chk->port && !is_addr(&chk->addr)) {
|
if (!chk->port && !is_addr(&chk->addr)) {
|
||||||
#ifdef USE_OPENSSL
|
|
||||||
chk->use_ssl |= (srv->use_ssl || (srv->proxy->options & PR_O_TCPCHK_SSL));
|
chk->use_ssl |= (srv->use_ssl || (srv->proxy->options & PR_O_TCPCHK_SSL));
|
||||||
#endif
|
|
||||||
chk->send_proxy |= (srv->pp_opts);
|
chk->send_proxy |= (srv->pp_opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1072,6 +1072,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newsrv->use_ssl = curproxy->defsrv.use_ssl;
|
||||||
newsrv->check.use_ssl = curproxy->defsrv.check.use_ssl;
|
newsrv->check.use_ssl = curproxy->defsrv.check.use_ssl;
|
||||||
newsrv->check.port = curproxy->defsrv.check.port;
|
newsrv->check.port = curproxy->defsrv.check.port;
|
||||||
if (newsrv->check.port)
|
if (newsrv->check.port)
|
||||||
@ -1096,9 +1097,6 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
|
|||||||
newsrv->onmarkedup = curproxy->defsrv.onmarkedup;
|
newsrv->onmarkedup = curproxy->defsrv.onmarkedup;
|
||||||
newsrv->consecutive_errors_limit
|
newsrv->consecutive_errors_limit
|
||||||
= curproxy->defsrv.consecutive_errors_limit;
|
= curproxy->defsrv.consecutive_errors_limit;
|
||||||
#ifdef OPENSSL
|
|
||||||
newsrv->use_ssl = curproxy->defsrv.use_ssl;
|
|
||||||
#endif
|
|
||||||
newsrv->uweight = newsrv->iweight
|
newsrv->uweight = newsrv->iweight
|
||||||
= curproxy->defsrv.iweight;
|
= curproxy->defsrv.iweight;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user