]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: server: Add a dictionary for server names.
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 20 May 2019 07:47:07 +0000 (09:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 5 Jun 2019 06:33:35 +0000 (08:33 +0200)
This patch only declares and defines a dictionary for the server
names (stored as ->id member field).

include/types/server.h
src/server.c

index 574d40ee78db6db4fb444eeeef6abb276bbd847c..4a0772685ae9726dc1c23c1256d30fdd26ce60ca 100644 (file)
@@ -175,6 +175,9 @@ enum srv_initaddr {
 #define SRV_SSL_O_EARLY_DATA   0x400  /* Allow using early data */
 #endif
 
+/* The server names dictionary */
+extern struct dict server_name_dict;
+
 struct pid_list {
        struct list list;
        pid_t pid;
index 97cc5e09d1edba40b1820c4456d457cf84446916..bec498c2a44e5a3468efe2c8783376c4a2e6ba92 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <types/applet.h>
 #include <types/cli.h>
+#include <types/dict.h>
 #include <types/global.h>
 #include <types/cli.h>
 #include <types/dns.h>
@@ -62,6 +63,12 @@ struct task *idle_conn_task = NULL;
 struct task *idle_conn_cleanup[MAX_THREADS] = { NULL };
 struct list toremove_connections[MAX_THREADS];
 
+/* The server names dictionary */
+struct dict server_name_dict = {
+       .name = "server names",
+       .values = EB_ROOT_UNIQUE,
+};
+
 int srv_downtime(const struct server *s)
 {
        if ((s->cur_state != SRV_ST_STOPPED) && s->last_change < now.tv_sec)            // ignore negative time