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.
This commit is contained in:
Willy Tarreau 2012-07-06 09:40:59 +02:00 committed by Willy Tarreau
parent 56e9c5e963
commit da92e2fb61
2 changed files with 9 additions and 0 deletions

View File

@ -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 @@ 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 {

View File

@ -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;
}