]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG/MINOR: checks: put a struct connection into the server
authorWilly Tarreau <wtarreau@exceliance.fr>
Fri, 6 Jul 2012 07:40:59 +0000 (09:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Sep 2012 19:51:26 +0000 (21:51 +0200)
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
src/cfgparse.c

index 1885eab63f0dea70a0b919ef0e2317c02382b0ec..7a405fd96a7e0e80251119f5ffa571154df39048 100644 (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 {
index e8e640ab8d8a2c257dca4b52a2e2223e27bb7fad..c623927b336bf9bff0d11860b597d6d4e89ac545 100644 (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;
                }