MINOR: server: Add a dictionary for server names.

This patch only declares and defines a dictionary for the server
names (stored as ->id member field).
This commit is contained in:
Frdric Lcaille 2019-05-20 09:47:07 +02:00 committed by Willy Tarreau
parent 84d6046a33
commit 7da71293e4
2 changed files with 10 additions and 0 deletions

View 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;

View 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