From da92e2fb61fa3df7f269637bf804afcb0bd51c48 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 6 Jul 2012 09:40:59 +0200 Subject: [PATCH] REORG/MINOR: checks: put a struct connection into the server This will be used to handle the connection state once it goes away from fdtab. There is no functional change at the moment. --- include/types/server.h | 2 ++ src/cfgparse.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/include/types/server.h b/include/types/server.h index 1885eab63f..7a405fd96a 100644 --- a/include/types/server.h +++ b/include/types/server.h @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -162,6 +163,7 @@ struct server { int puid; /* proxy-unique server ID, used for SNMP, and "first" LB algo */ char *check_data; /* storage of partial check results */ + struct connection *check_conn; /* connection state for health checks */ int check_data_len; /* length of partial check results stored in check_data */ struct { diff --git a/src/cfgparse.c b/src/cfgparse.c index e8e640ab8d..c623927b33 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -4646,6 +4646,13 @@ stats_error_parsing: goto out; } + /* Allocate buffer for partial check results... */ + if ((newsrv->check_conn = calloc(1, sizeof(struct connection))) == NULL) { + Alert("parsing [%s:%d] : out of memory while allocating check connection.\n", file, linenum); + err_code |= ERR_ALERT | ERR_ABORT; + goto out; + } + newsrv->check_status = HCHK_STATUS_INI; newsrv->state |= SRV_CHECKED; } -- 2.47.3