MINOR: server: remove a few unneeded LIST_INIT calls after LIST_DEL_LOCKED

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.
This commit is contained in:
Willy Tarreau 2019-02-28 16:06:56 +01:00
parent 4c747e86cd
commit c912f94b57
3 changed files with 2 additions and 6 deletions

View File

@ -699,7 +699,6 @@ static inline void conn_free(struct connection *conn)
conn_force_unsubscribe(conn); conn_force_unsubscribe(conn);
LIST_DEL_LOCKED(&conn->list); LIST_DEL_LOCKED(&conn->list);
LIST_INIT(&conn->list);
pool_free(pool_head_connection, conn); pool_free(pool_head_connection, conn);
} }

View File

@ -1309,11 +1309,9 @@ int connect_server(struct stream *s)
s->txn && (s->txn->flags & TX_NOT_FIRST)))) { s->txn && (s->txn->flags & TX_NOT_FIRST)))) {
srv_conn = LIST_POP_LOCKED(&srv->idle_orphan_conns[tid], srv_conn = LIST_POP_LOCKED(&srv->idle_orphan_conns[tid],
struct connection *, list); struct connection *, list);
if (srv_conn) { if (srv_conn)
LIST_INIT(&srv_conn->list);
reuse_orphan = 1; reuse_orphan = 1;
} }
}
/* If we've picked a connection from the pool, we now have to /* If we've picked a connection from the pool, we now have to
* detach it. We may have to get rid of the previous idle * detach it. We may have to get rid of the previous idle

View File

@ -5317,7 +5317,6 @@ struct task *srv_cleanup_toremove_connections(struct task *task, void *context,
while ((conn = LIST_POP_LOCKED(&toremove_connections[tid], while ((conn = LIST_POP_LOCKED(&toremove_connections[tid],
struct connection *, list)) != NULL) { struct connection *, list)) != NULL) {
LIST_INIT(&conn->list);
conn->mux->destroy(conn); conn->mux->destroy(conn);
} }