From cfe9bec1ea978a28095c49f661f55014f0453514 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Wed, 30 Jul 2025 09:51:21 +0200 Subject: [PATCH] MINOR: mux-quic: release conn after shutdown on BE reuse failure On stream detach on backend side, connection is inserted in the proper server/session list to be able to reuse it later. If insertion fails and the connection is idle, the connection can be removed immediately. If this occurs on a QUIC connection, QUIC MUX implements graceful shutdown to ensure the server is notified of the closure. However, the connection instance is not freed. Change this to ensure that both shutdown and release is performed. --- src/mux_quic.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/mux_quic.c b/src/mux_quic.c index 1a0db225c..cd014db23 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -3791,10 +3791,8 @@ static void qmux_strm_detach(struct sedesc *sd) if (!session_add_conn(sess, conn, conn->target)) { TRACE_ERROR("error during connection insert into session list", QMUX_EV_STRM_END, conn); conn->owner = NULL; - if (!qcc->nb_sc) { - qcc_shutdown(qcc); - goto end; - } + if (!qcc->nb_sc) + goto release; } /* If conn is idle, check if session can keep it. Conn is freed if this is not the case. @@ -3812,8 +3810,9 @@ static void qmux_strm_detach(struct sedesc *sd) if (!srv_add_to_idle_list(objt_server(conn->target), conn, 1)) { /* Idle conn insert failure, gracefully close the connection. */ TRACE_DEVEL("idle connection cannot be kept on the server", QMUX_EV_STRM_END, conn); - qcc_shutdown(qcc); + goto release; } + goto end; } else if (!conn->hash_node->node.node.leaf_p && -- 2.47.2