From b01a00acb15ef5a321d8e51e8491b83a586f363d Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Thu, 2 Oct 2025 14:02:03 +0200 Subject: [PATCH] BUG/MEDIUM: connections: Only avoid creating a mux if we have one In connect_server(), only avoid creating a mux when we're reusing a connection, if that connection already has one. We can reuse a connection with no mux, if we made a first attempt at connecting to the server and it failed before we could create the mux (or during the mux creation). The connection will then be reused when trying again. This fixes a bug where a stream could stall if the first connection attempt failed before the mux creation. It is easy to reproduce by creating random memory allocation failure with -dmFail. This was introduced by commit 4aaf0bfbced22d706af08725f977dcce9845d340, and thus does not need any backport as long as that commit is not backported. --- src/backend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend.c b/src/backend.c index 135b2c4a0..69842e343 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1844,7 +1844,8 @@ int connect_server(struct stream *s) if (err == SF_ERR_NONE) { srv_conn = sc_conn(s->scb); reuse = 1; - may_start_mux_now = 0; + if (srv_conn && srv_conn->mux) + may_start_mux_now = 0; } } -- 2.47.3