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.
This commit is contained in:
Amaury Denoyelle 2026-04-15 14:33:31 +02:00
parent 497cabd9e5
commit e2dbcd20f2
2 changed files with 5 additions and 2 deletions

View file

@ -5263,7 +5263,8 @@ tune.quic.fe.stream.max-concurrent <number>
tune.quic.fe.stream.max-total <number>
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

View file

@ -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;
}