MINOR: quic: ensure txbuf realloc is only performed on empty buffer
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 1 Oct 2024 08:55:40 +0000 (10:55 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 1 Oct 2024 09:51:51 +0000 (11:51 +0200)
commitfdc16c1e01fc7fcf4479043c71e7a54cf49a6bc9
treef63362a53dbb3411fc6315f816f58b6ec5ffb2fb
parent172404a8ecbc0df6425c7f7ee1a9cd633a920ebd
MINOR: quic: ensure txbuf realloc is only performed on empty buffer

QUIC application protocol layer has the ability to either allocate a
standard buffer or a smaller one. The latter is useful when only small
data are transferred to prevent consuming too much of the QUIC MUX
buffer window.

This operation is performed using qc_stream_buf_realloc(). Add a new
BUG_ON() in it to ensure no data is present in the buffer. Indeed, this
would cause to data loss, or even crash when trying to acknowledge data.

Note that for the moment qc_stream_buf_realloc() is only use for HTTP/3
headers transmission, and this usage is conform to the new BUG_ON. This
commit is thus not a bug fix, but only to strengthen the API.
src/quic_stream.c