]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: connections: Remove the connection from the idle list before destroy.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 29 Nov 2018 17:04:12 +0000 (18:04 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 1 Dec 2018 09:47:16 +0000 (10:47 +0100)
Before calling the destroy() method, remove the connection from the idle list,
so that no new session will pick it.

src/backend.c

index 8e2769685c8d26aaed4a47534f53a80a10eabc50..19157baa6719b3f2b1a335e97e5ee02f629de51b 100644 (file)
@@ -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;
                }
        }