MINOR: server: introduction of 3 new server flags
Introduction of 3 new server flags to remember if some parameters were set
during configuration parsing.
* SRV_F_CHECKADDR: this server has a check addr configured
* SRV_F_CHECKPORT: this server has a check port configured
* SRV_F_AGENTADDR: this server has a agent addr configured
diff --git a/include/types/server.h b/include/types/server.h
index 952671c..ce13820 100644
--- a/include/types/server.h
+++ b/include/types/server.h
@@ -98,6 +98,9 @@
#define SRV_F_NON_STICK 0x0004 /* never add connections allocated to this server to a stick table */
#define SRV_F_USE_NS_FROM_PP 0x0008 /* use namespace associated with connection if present */
#define SRV_F_FORCED_ID 0x0010 /* server's ID was forced in the configuration */
+#define SRV_F_CHECKADDR 0x0020 /* this server has a check addr configured */
+#define SRV_F_CHECKPORT 0x0040 /* this server has a check port configured */
+#define SRV_F_AGENTADDR 0x0080 /* this server has a agent addr configured */
/* configured server options for send-proxy (server->pp_opts) */
#define SRV_PP_V1 0x0001 /* proxy protocol version 1 */
diff --git a/src/server.c b/src/server.c
index e41afc7..a90ae9b 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1002,6 +1002,8 @@
newsrv->check.use_ssl = curproxy->defsrv.check.use_ssl;
newsrv->check.port = curproxy->defsrv.check.port;
+ if (newsrv->check.port)
+ newsrv->flags |= SRV_F_CHECKPORT;
newsrv->check.inter = curproxy->defsrv.check.inter;
newsrv->check.fastinter = curproxy->defsrv.check.fastinter;
newsrv->check.downinter = curproxy->defsrv.check.downinter;
@@ -1292,10 +1294,13 @@
}
newsrv->check.addr = newsrv->agent.addr = *sk;
+ newsrv->flags |= SRV_F_CHECKADDR;
+ newsrv->flags |= SRV_F_AGENTADDR;
cur_arg += 2;
}
else if (!strcmp(args[cur_arg], "port")) {
newsrv->check.port = atol(args[cur_arg + 1]);
+ newsrv->flags |= SRV_F_CHECKPORT;
cur_arg += 2;
}
else if (!defsrv && !strcmp(args[cur_arg], "backup")) {