]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: servers: Use LIST_DEL_INIT() instead of LIST_DEL().
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 20 Sep 2019 16:08:29 +0000 (18:08 +0200)
committerOlivier Houchard <cognet@ci0.org>
Mon, 23 Sep 2019 16:16:08 +0000 (18:16 +0200)
In srv_add_to_idle_list(), use LIST_DEL_INIT instead of just LIST_DEL.
We're about to add the connection to a mt_list, and MT_LIST_ADD/MT_LIST_ADDQ
will be modified to make sure we're not adding the element if it's already
in a list.

include/proto/server.h

index 5a2fcc919290af6548c62dc2704e6c719f8cb703..0844e8aeb895ead91e890a6ddc5ccdab7fd025e3 100644 (file)
@@ -261,7 +261,7 @@ static inline int srv_add_to_idle_list(struct server *srv, struct connection *co
                        _HA_ATOMIC_SUB(&srv->curr_idle_conns, 1);
                        return 0;
                }
-               LIST_DEL(&conn->list);
+               LIST_DEL_INIT(&conn->list);
                MT_LIST_ADDQ(&srv->idle_orphan_conns[tid], (struct mt_list *)&conn->list);
                srv->curr_idle_thr[tid]++;