From: Amaury Denoyelle Date: Wed, 14 Oct 2020 16:17:05 +0000 (+0200) Subject: MINOR: connection: improve list api usage X-Git-Tag: v2.3-dev7~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c98df5fb4409160a60f1d391059be42568ea13e4;p=thirdparty%2Fhaproxy.git MINOR: connection: improve list api usage Replace !LIST_ISEMPTY by LIST_ADDED and LIST_DEL+LIST_INIT by LIST_DEL_INIT for connection session list. --- diff --git a/include/haproxy/connection.h b/include/haproxy/connection.h index 2e01a2d546..37d3f4280f 100644 --- a/include/haproxy/connection.h +++ b/include/haproxy/connection.h @@ -468,7 +468,7 @@ static inline void conn_free(struct connection *conn) /* The connection is private, so remove it from the session's * connections list, if any. */ - if (!LIST_ISEMPTY(&conn->session_list)) + if (LIST_ADDED(&conn->session_list)) session_unown_conn(conn->owner, conn); } else { diff --git a/include/haproxy/session.h b/include/haproxy/session.h index 05c56f6024..59945b2ba4 100644 --- a/include/haproxy/session.h +++ b/include/haproxy/session.h @@ -80,8 +80,7 @@ static inline void session_unown_conn(struct session *sess, struct connection *c if (conn->flags & CO_FL_SESS_IDLE) sess->idle_conns--; - LIST_DEL(&conn->session_list); - LIST_INIT(&conn->session_list); + LIST_DEL_INIT(&conn->session_list); list_for_each_entry(srv_list, &sess->srv_list, srv_list) { if (srv_list->target == conn->target) { if (LIST_ISEMPTY(&srv_list->conn_list)) {