]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: quic: Use a non-contiguous buffer for RX CRYPTO data
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 13 Sep 2022 12:36:44 +0000 (14:36 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Thu, 13 Oct 2022 08:12:03 +0000 (10:12 +0200)
commit9f9263ed13ab28a492323484c4c4be89f218848f
tree1cb7739d49b26b5a1c709267fe0365391a2370a9
parenta20c93e6e2b3dfc2deaa96ff1d5890b1eda290b9
MINOR: quic: Use a non-contiguous buffer for RX CRYPTO data

Implement quic_get_ncbuf() to dynamically allocate a new ncbuf to be attached to
any quic_cstream struct which needs such a buffer. Note that there is no quic_cstream
for 0RTT encryption level. quic_free_ncbuf() is added to release the memory
allocated for a non-contiguous buffer.

Modify qc_handle_crypto_frm() to call this function and allocate an ncbuf for
crypto data which are not received in order. The crypto data which are received in
order are not buffered but provide to the TLS stack (calling qc_provide_cdata()).

Modify qc_treat_rx_crypto_frms() which is called after having provided the
in order received crypto data to the TLS stack to provide again the remaining
crypto data which has been buffered, if possible (if they are in order). Each time
buffered CRYPTO data were consumed, we try to release the memory allocated for
the non-contiguous buffer (ncbuf).
Also move rx.crypto.offset quic_enc_level struct member to rx.offset quic_cstream
struct member.

Must be backported to 2.6.
include/haproxy/quic_conn-t.h
src/quic_conn.c