]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: server: add a list of safe, already reused idle connections
authorWilly Tarreau <w@1wt.eu>
Wed, 5 Aug 2015 14:35:23 +0000 (16:35 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 6 Aug 2015 14:29:01 +0000 (16:29 +0200)
These ones are considered safe as they have already been reused.
They will be useful in "aggressive" and "always" http-reuse modes
in order to place the first request of a connection with the least
risk.

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

index 411ea4b423a47937ad6ddd06d1184ecb67958c35..cbeead9bded2bc7a99bd1fc8a6b83fe6a6f27415 100644 (file)
@@ -168,6 +168,7 @@ struct server {
        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 list safe_conns;                 /* safe idle connections attached to stream interfaces, shared */
        struct task *warmup;                    /* the task dedicated to the warmup when slowstart is set */
 
        struct conn_src conn_src;               /* connection source settings */
index df3904f06091406e11c35e28f31f726df3e9c299..678935165181d9641a821e7aa1a880d5972e8d1b 100644 (file)
@@ -5062,6 +5062,7 @@ void hlua_init(void)
        LIST_INIT(&socket_tcp.pendconns);
        LIST_INIT(&socket_tcp.priv_conns);
        LIST_INIT(&socket_tcp.idle_conns);
+       LIST_INIT(&socket_tcp.safe_conns);
        socket_tcp.state = SRV_ST_RUNNING; /* early server setup */
        socket_tcp.last_change = 0;
        socket_tcp.id = "LUA-TCP-CONN";
@@ -5107,6 +5108,7 @@ void hlua_init(void)
        LIST_INIT(&socket_ssl.pendconns);
        LIST_INIT(&socket_ssl.priv_conns);
        LIST_INIT(&socket_ssl.idle_conns);
+       LIST_INIT(&socket_ssl.safe_conns);
        socket_ssl.state = SRV_ST_RUNNING; /* early server setup */
        socket_ssl.last_change = 0;
        socket_ssl.id = "LUA-SSL-CONN";
index e33f68645b5c1fb10c2aaddec3dbd1ddd86f8648..b7a498c2629c416515f05f416da4abfde81ad280 100644 (file)
@@ -888,6 +888,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
                        LIST_INIT(&newsrv->pendconns);
                        LIST_INIT(&newsrv->priv_conns);
                        LIST_INIT(&newsrv->idle_conns);
+                       LIST_INIT(&newsrv->safe_conns);
                        do_check = 0;
                        do_agent = 0;
                        newsrv->flags = 0;