diff --git a/include/proto/session.h b/include/proto/session.h index 0b7d08d99..f1e33fa0c 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 9e95b328a..2732dbca8 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 {