]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: quic: refactor STREAM encoding and splitting
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 7 Feb 2025 17:48:18 +0000 (18:48 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 12 Feb 2025 14:10:03 +0000 (15:10 +0100)
commitf96af8e46373c0f95c7ba8f208eb2fa7f3a3e06c
tree196ccf16fdec09f1739de362242dd8c60c098cf5
parent0b9a75e8781593c250f6366a64a019018ade688e
MINOR: quic: refactor STREAM encoding and splitting

CRYPTO and STREAM frames encoding is similar. If payload is too large,
frame will be splitted and only the first payload part will be written
in the output QUIC packet. This process is complexified by the presence
of a variable-length integer Length field prior to the payload.

This commit aims at refactor these operations. Define two functions to
simplify the code :
* quic_strm_frm_fillbuf() which is used to calculate the optimal frame
  length of a STREAM/CRYPTO frame with its payload in a buffer
* quic_strm_frm_split() which is used to split the frame payload if
  buffer is too small

With this patch, both functions are now implemented for STREAM encoding.
include/haproxy/quic_frame.h
src/quic_frame.c
src/quic_tx.c