]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: server: add a list of already used idle connections
authorWilly Tarreau <w@1wt.eu>
Wed, 5 Aug 2015 08:31:57 +0000 (10:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 6 Aug 2015 09:13:47 +0000 (11:13 +0200)
There's a difference with the other idle conns in that these new
ones have already been used and may be reused by other streams.

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

index f72ca0c8dc99085292f99f77ec2c4174cab905c8..411ea4b423a47937ad6ddd06d1184ecb67958c35 100644 (file)
@@ -167,6 +167,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 list idle_conns;                 /* sharable idle connections attached or not to a stream interface */
        struct task *warmup;                    /* the task dedicated to the warmup when slowstart is set */
 
        struct conn_src conn_src;               /* connection source settings */
index 08831ab57b41c31efc833e5c041937f05d4d271f..df3904f06091406e11c35e28f31f726df3e9c299 100644 (file)
@@ -5061,6 +5061,7 @@ void hlua_init(void)
        LIST_INIT(&socket_tcp.actconns);
        LIST_INIT(&socket_tcp.pendconns);
        LIST_INIT(&socket_tcp.priv_conns);
+       LIST_INIT(&socket_tcp.idle_conns);
        socket_tcp.state = SRV_ST_RUNNING; /* early server setup */
        socket_tcp.last_change = 0;
        socket_tcp.id = "LUA-TCP-CONN";
@@ -5105,6 +5106,7 @@ void hlua_init(void)
        LIST_INIT(&socket_ssl.actconns);
        LIST_INIT(&socket_ssl.pendconns);
        LIST_INIT(&socket_ssl.priv_conns);
+       LIST_INIT(&socket_ssl.idle_conns);
        socket_ssl.state = SRV_ST_RUNNING; /* early server setup */
        socket_ssl.last_change = 0;
        socket_ssl.id = "LUA-SSL-CONN";
index 44f0dc385d8af15cee08b54d56f4efdc4aa7593e..e33f68645b5c1fb10c2aaddec3dbd1ddd86f8648 100644 (file)
@@ -887,6 +887,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
                        LIST_INIT(&newsrv->actconns);
                        LIST_INIT(&newsrv->pendconns);
                        LIST_INIT(&newsrv->priv_conns);
+                       LIST_INIT(&newsrv->idle_conns);
                        do_check = 0;
                        do_agent = 0;
                        newsrv->flags = 0;