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.
diff --git a/include/types/server.h b/include/types/server.h
index 1885eab..7a405fd 100644
--- a/include/types/server.h
+++ b/include/types/server.h
@@ -30,6 +30,7 @@
#include <eb32tree.h>
#include <types/buffers.h>
+#include <types/connection.h>
#include <types/counters.h>
#include <types/freq_ctr.h>
#include <types/port_range.h>
@@ -162,6 +163,7 @@
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 e8e640a..c623927 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -4646,6 +4646,13 @@
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;
}