From 8788b4111c78be8397155949f245e6b34caa6acd Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Thu, 31 Jan 2019 19:31:19 +0100 Subject: [PATCH] BUG/MEDIUM: connections: Don't forget to remove CO_FL_SESS_IDLE. If we're adding a connection to the server orphan idle list, don't forget to remove the CO_FL_SESS_IDLE flag, or we will assume later it's still attached to a session. This should be backported to 1.9. --- include/proto/session.h | 3 ++- src/session.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/proto/session.h b/include/proto/session.h index 0b7d08d..f1e33fa 100644 --- a/include/proto/session.h +++ b/include/proto/session.h @@ -128,7 +128,8 @@ static inline int session_check_idle_conn(struct session *sess, struct connectio /* The server doesn't want it, let's kill the connection right away */ conn->mux->destroy(conn); return -1; - } + } else + conn->flags &= ~CO_FL_SESS_IDLE; return 1; } else { conn->flags |= CO_FL_SESS_IDLE; diff --git a/src/session.c b/src/session.c index 9e95b32..2732dbc 100644 --- a/src/session.c +++ b/src/session.c @@ -87,6 +87,7 @@ void session_free(struct session *sess) 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)) conn->mux->destroy(conn); } else { -- 1.7.10.4