From: Amaury Denoyelle Date: Wed, 13 May 2026 06:02:09 +0000 (+0200) Subject: MINOR: h2: explain committed_extra_streams dec on h2_init() error X-Git-Tag: v3.4-dev13~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ad3562fea189c6473de3568b2bcd03587c4b5813;p=thirdparty%2Fhaproxy.git MINOR: h2: explain committed_extra_streams dec on h2_init() error h2_init() is now responsible to increment committed_extra_streams for new frontend connections, in relation to the newly implemented stream-elasticity feature. In case of an early error, a mirroring decrement is executed on fail_stream label. However, for now this error label can only be selected via BE conns. In fact, it's not yet possible for h2_init() to fail after the extra streams increment. However, the decrement operation is kept to prevent any omissions in case of future evolutions of h2_init() error path. To prevent reporting of a possible dead code, add an extra comment which summarizes the situation. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 3708925a6..1c29cf5cc 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -1527,6 +1527,9 @@ static int h2_init(struct connection *conn, struct proxy *prx, struct session *s TRACE_LEAVE(H2_EV_H2C_NEW, conn); return 0; fail_stream: + /* Unnecessary code for now as fail_stream only occurs with BE conns. + * Still better though to keep it to prevent future mistakes. + */ if (!(h2c->flags & H2_CF_IS_BACK) && h2c->streams_hard_limit > 1) _HA_ATOMIC_SUB(&tg_ctx->committed_extra_streams, h2c->streams_hard_limit - 1); hpack_dht_free(h2c->ddht);