From a30a40bcca0f391a62629a8eab5be5ba3defbf93 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Thu, 29 Nov 2018 18:04:12 +0100 Subject: [PATCH] BUG/MEDIUM: connections: Remove the connection from the idle list before destroy. Before calling the destroy() method, remove the connection from the idle list, so that no new session will pick it. --- src/backend.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend.c b/src/backend.c index 8e2769685..19157baa6 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1213,7 +1213,10 @@ int connect_server(struct stream *s) */ if (old_conn && !did_switch) { old_conn->owner = NULL; - old_conn->mux->destroy(old_conn); + LIST_DEL(&old_conn->list); + LIST_INIT(&old_conn->list); + if (old_conn->mux) + old_conn->mux->destroy(old_conn); old_conn = NULL; } }