From e2dbcd20f245e856cf474ff481e1363c196cb309 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Wed, 15 Apr 2026 14:33:31 +0200 Subject: [PATCH] MINOR: mux-quic: close connection when reaching max-total streams This commit completes the previous one which implements a new setting to limit the number of streams usable by a client on a QUIC connection. When the connection becomes idle after reaching this limit, it is immediately closed. This is implemented by extending checks in qcc_is_dead(). This results in a CONNECTION_CLOSE emission, which is useful to free resources as soon as possible. --- doc/configuration.txt | 3 ++- src/mux_quic.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index 905c06810..1568978fb 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -5263,7 +5263,8 @@ tune.quic.fe.stream.max-concurrent tune.quic.fe.stream.max-total Sets the maximum number of requests that can be handled by a single QUIC connection. Once this total is reached, the connection will be gracefully - shutdown. In HTTP/3, this translates in a GOAWAY frame. + shutdown. In HTTP/3, this translates in a GOAWAY frame. The connection is + finally closed when all remaining transfers are completed. This setting is applied as a hard limit on the connection via the QUIC flow control mechanism. If a peer violates it, the connection will be immediately diff --git a/src/mux_quic.c b/src/mux_quic.c index aed5b941e..d0c84ccbe 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -287,9 +287,11 @@ static inline int qcc_is_dead(const struct qcc *qcc) * - remote error detected at transport level * - error detected locally * - MUX timeout expired + * - app layer shut and all transfers done (FE side only - used for stream.max-total) */ if (qcc->flags & (QC_CF_ERR_CONN|QC_CF_ERRL_DONE) || - !qcc->task) { + !qcc->task || + (!conn_is_back(qcc->conn) && !qcc->nb_hreq && qcc->app_st == QCC_APP_ST_SHUT)) { return 1; }