]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: server: add a list of private idle connections
authorWilly Tarreau <w@1wt.eu>
Tue, 4 Aug 2015 15:19:06 +0000 (17:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 6 Aug 2015 08:59:08 +0000 (10:59 +0200)
For now it's not populated but we have the list entry. It will carry
all idle connections that sessions don't want to share. They may be
used later to reclaim connections upon socket shortage for example.

include/types/server.h
src/hlua.c
src/server.c

index 130c370f7a0230fcb8ad8db0f18481acb4770195..f72ca0c8dc99085292f99f77ec2c4174cab905c8 100644 (file)
@@ -166,6 +166,7 @@ struct server {
 
        struct list pendconns;                  /* pending connections */
        struct list actconns;                   /* active connections */
+       struct list priv_conns;                 /* private idle connections attached to stream interfaces */
        struct task *warmup;                    /* the task dedicated to the warmup when slowstart is set */
 
        struct conn_src conn_src;               /* connection source settings */
index 1c2938b856868e6476e7e84bf9d1825dbd51f966..08831ab57b41c31efc833e5c041937f05d4d271f 100644 (file)
@@ -5060,6 +5060,7 @@ void hlua_init(void)
        socket_tcp.obj_type = OBJ_TYPE_SERVER;
        LIST_INIT(&socket_tcp.actconns);
        LIST_INIT(&socket_tcp.pendconns);
+       LIST_INIT(&socket_tcp.priv_conns);
        socket_tcp.state = SRV_ST_RUNNING; /* early server setup */
        socket_tcp.last_change = 0;
        socket_tcp.id = "LUA-TCP-CONN";
@@ -5103,6 +5104,7 @@ void hlua_init(void)
        socket_ssl.obj_type = OBJ_TYPE_SERVER;
        LIST_INIT(&socket_ssl.actconns);
        LIST_INIT(&socket_ssl.pendconns);
+       LIST_INIT(&socket_ssl.priv_conns);
        socket_ssl.state = SRV_ST_RUNNING; /* early server setup */
        socket_ssl.last_change = 0;
        socket_ssl.id = "LUA-SSL-CONN";
index 503d53ab36fc5688454b53dd0d7e88577df6ca46..44f0dc385d8af15cee08b54d56f4efdc4aa7593e 100644 (file)
@@ -886,6 +886,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
                        newsrv->obj_type = OBJ_TYPE_SERVER;
                        LIST_INIT(&newsrv->actconns);
                        LIST_INIT(&newsrv->pendconns);
+                       LIST_INIT(&newsrv->priv_conns);
                        do_check = 0;
                        do_agent = 0;
                        newsrv->flags = 0;