mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-22 14:49:45 -04:00
CLEANUP: session: slightly simplify idle connection cleanup logic
Since previous commit a132e5efa9 ("BUG/MEDIUM: Make sure we leave the
session list in session_free().") it's pointless to delete the conn
element inside "if" blocks given that the second test is always true
as well. Let's simplify this with a single LIST_DEL_INIT() before the
test.
This commit is contained in:
parent
a132e5efa9
commit
5de7817ae8
1 changed files with 1 additions and 7 deletions
|
|
@ -78,10 +78,8 @@ void session_free(struct session *sess)
|
|||
conn->mux->destroy(conn->ctx);
|
||||
list_for_each_entry_safe(srv_list, srv_list_back, &sess->srv_list, srv_list) {
|
||||
list_for_each_entry_safe(conn, conn_back, &srv_list->conn_list, session_list) {
|
||||
LIST_DEL_INIT(&conn->session_list);
|
||||
if (conn->mux) {
|
||||
|
||||
LIST_DEL(&conn->session_list);
|
||||
LIST_INIT(&conn->session_list);
|
||||
conn->owner = NULL;
|
||||
conn->flags &= ~CO_FL_SESS_IDLE;
|
||||
if (!srv_add_to_idle_list(objt_server(conn->target), conn))
|
||||
|
|
@ -90,10 +88,6 @@ void session_free(struct session *sess)
|
|||
/* We have a connection, but not yet an associated mux.
|
||||
* So destroy it now.
|
||||
*/
|
||||
if (!LIST_ISEMPTY(&conn->session_list)) {
|
||||
LIST_DEL(&conn->session_list);
|
||||
LIST_INIT(&conn->session_list);
|
||||
}
|
||||
conn_stop_tracking(conn);
|
||||
conn_full_close(conn);
|
||||
conn_free(conn);
|
||||
|
|
|
|||
Loading…
Reference in a new issue