BUG/MINOR: h3: fix TRAILERS encoding
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 28 Nov 2023 14:59:38 +0000 (15:59 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 29 Nov 2023 08:24:19 +0000 (09:24 +0100)
commit81a4cc666d889636def3578a03945c23172c7d25
treee2ea35c607bea41fe8499daf0a8923109427070f
parent07691a2e7c38501f44cfeaf657c1952e3c28a1f4
BUG/MINOR: h3: fix TRAILERS encoding

HTTP/3 trailers encoding was never working as intended. It's because
h3_trailers_to_htx() manipulate a newly allocated buffer instead of the
already existing channel one. Thus, HTX message handled by the stream
was incomplete as it lacked trailers and EOM.

Fix this by reusing the already allocated channel buffer in
h3_trailers_to_htx().

This bug was detected by simulating TRAILERS emission which generate
CL--- state due to missing request side termination signal. Its impact
is deemed as minimal as trailers are pretty infrequent for now in
HTTP/3.

This must be backported up to 2.7.
src/h3.c