]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: server: remove a few unneeded LIST_INIT calls after LIST_DEL_LOCKED
authorWilly Tarreau <w@1wt.eu>
Thu, 28 Feb 2019 15:06:56 +0000 (16:06 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 28 Feb 2019 15:08:54 +0000 (16:08 +0100)
Since LIST_DEL_LOCKED() and LIST_POP_LOCKED() now automatically reinitialize
the removed element, there's no need for keeping this LIST_INIT() call in the
idle connection code.

include/proto/connection.h
src/backend.c
src/server.c

index 3bfad58ef298102acfa991861d4e0a29517cfeac..1326a15f97eff9559d2bc6585c3b914b95a2986e 100644 (file)
@@ -699,7 +699,6 @@ static inline void conn_free(struct connection *conn)
 
        conn_force_unsubscribe(conn);
        LIST_DEL_LOCKED(&conn->list);
-       LIST_INIT(&conn->list);
        pool_free(pool_head_connection, conn);
 }
 
index ace0ca402082e44ea81a028dd3842100cf113ff7..dfdb9b5319db634096c96ddb27106953dd2e9218 100644 (file)
@@ -1308,11 +1308,9 @@ int connect_server(struct stream *s)
                    (((s->be->options & PR_O_REUSE_MASK) != PR_O_REUSE_NEVR) &&
                     s->txn && (s->txn->flags & TX_NOT_FIRST)))) {
                        srv_conn = LIST_POP_LOCKED(&srv->idle_orphan_conns[tid],
-                           struct connection *, list);
-                       if (srv_conn) {
-                               LIST_INIT(&srv_conn->list);
+                                                  struct connection *, list);
+                       if (srv_conn)
                                reuse_orphan = 1;
-                       }
                }
 
                /* If we've picked a connection from the pool, we now have to
index b9336f5650aababbd7a87668d93b890306a9bcb1..bffc2ee50cf0f1f8eb210aa15050ecbf61f71217 100644 (file)
@@ -5317,7 +5317,6 @@ struct task *srv_cleanup_toremove_connections(struct task *task, void *context,
 
        while ((conn = LIST_POP_LOCKED(&toremove_connections[tid],
                                       struct connection *, list)) != NULL) {
-               LIST_INIT(&conn->list);
                conn->mux->destroy(conn);
        }