From: Olivier Houchard Date: Thu, 29 Nov 2018 17:04:12 +0000 (+0100) Subject: BUG/MEDIUM: connections: Remove the connection from the idle list before destroy. X-Git-Tag: v1.9-dev9~103 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a30a40bcca0f391a62629a8eab5be5ba3defbf93;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/backend.c b/src/backend.c index 8e2769685c..19157baa67 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; } }