]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: mux_quic: fix max stream ID reuse estimation
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 7 May 2026 08:28:51 +0000 (10:28 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 7 May 2026 08:53:56 +0000 (10:53 +0200)
commite586458ec0c22c6a1f26b2d4dd98fec1f07fabc1
treeb59ac79e2cec3862437c55cdc9f53778d9e76829
parent753a282373b450b5c4e558c85d22b226a49030f6
BUG/MINOR: mux_quic: fix max stream ID reuse estimation

The following patch adjusts QUIC mux avail_streams() to ensure maximum
stream ID is never exceeded.

  commit 143d0034c912f1490812b6302f0dffb37f3ec02d
  BUG/MINOR: mux_quic: limit avail_streams() to 2^62

However, the calcul is incorrect, as <next_bidi_l> member value is set
to the next ID available, not the last one in use. Also, when the last
stream is closed, it will be greater than QCS_ID_MAX_STRM_CL_BIDI,
resulting in a substraction wrapping.

Fix this by using the simplest approach. Return value of avail_streams()
is only reduced if either the maximum stream ID limit is already
exceeded, or there is only a single stream still usable. In other cases,
return value is left as is.

Note that this bug is unlikely to have any impact as the maximum stream
ID is a very large value.

This should be backported up to 3.3.
src/mux_quic.c