MINOR: server: Constify source server to copy its settings
The source server used to initialize a new server, in srv_settings_cpy() and
sub-functions, is now a constant.
This patch is mandatory to fix a bug.
diff --git a/src/server.c b/src/server.c
index 5cf0eac..73a7323 100644
--- a/src/server.c
+++ b/src/server.c
@@ -2000,8 +2000,7 @@
ha_alert("%s%s%s%s.\n", msg, quote, token, quote);
}
-static void srv_conn_src_sport_range_cpy(struct server *srv,
- struct server *src)
+static void srv_conn_src_sport_range_cpy(struct server *srv, const struct server *src)
{
int range_sz;
@@ -2022,7 +2021,7 @@
/*
* Copy <src> server connection source settings to <srv> server everything needed.
*/
-static void srv_conn_src_cpy(struct server *srv, struct server *src)
+static void srv_conn_src_cpy(struct server *srv, const struct server *src)
{
srv->conn_src.opts = src->conn_src.opts;
srv->conn_src.source_addr = src->conn_src.source_addr;
@@ -2048,7 +2047,7 @@
* everything needed.
*/
#if defined(USE_OPENSSL)
-static void srv_ssl_settings_cpy(struct server *srv, struct server *src)
+static void srv_ssl_settings_cpy(struct server *srv, const struct server *src)
{
/* <src> is the current proxy's default server and SSL is enabled */
BUG_ON(src->ssl_ctx.ctx != NULL); /* the SSL_CTX must never be initialized in a default-server */
@@ -2170,7 +2169,7 @@
* <srv_tmpl> distinguishes these two cases (must be 1 if <srv> is a template,
* 0 if not).
*/
-static void srv_settings_cpy(struct server *srv, struct server *src, int srv_tmpl)
+static void srv_settings_cpy(struct server *srv, const struct server *src, int srv_tmpl)
{
/* Connection source settings copy */
srv_conn_src_cpy(srv, src);