]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: quic: support frame type as a varint
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 12 Feb 2025 16:49:09 +0000 (17:49 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 14 Feb 2025 08:00:05 +0000 (09:00 +0100)
commit32691e7c255a944224e0ac17d0f83f217be6c5d6
treeca3d907eb2f076bc79080c14da9209ada42e37d4
parent2fe4cbd8e5a805f23deecec2083a87f3cf9f2077
MINOR: quic: support frame type as a varint

QUIC frame type is encoded as a variable-length integer. Thus, 64-bit
integer should be used for them. Currently, this was not the case as
type was represented as a 1-byte char inside quic_frame structure. This
does not cause any issue with QUIC from RFC9000, as all frame types fit
in this range. Furthermore, a QUIC implementation is required to use the
smallest size varint when encoding a frame type.

However, the current code is unable to accept QUIC extension with bigger
frame types. This is notably the case for quic-on-streams draft. Thus,
this commit readjusts quic_frame architecture to be able to support
higher frame type values.

First, type field of quic_frame is changed to a 64-bits variable. Both
encoding and decoding frame functions uses variable-length integer
helpers to manipulate the frame type field.

Secondly, the quic_frame builders/parsers infrastructure is still
preserved. However, it could be impossible to define new large frame
type as an index into quic_frame_builders / quic_frame_parsers arrays.
Thus, wrapper functions are now provided to access the builders and
parsers. Both qf_builder() and qf_parser() wrappers can then be extended
to return custom builder/parser instances for larger frame type.

Finally, unknown frame type detection also uses the new wrapper
quic_frame_is_known(). As with builders/parsers, for large frame type,
this function must be manually completed to support a new type value.
include/haproxy/quic_frame-t.h
include/haproxy/quic_frame.h
src/quic_frame.c