]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: h3: fix missing EOM after trailers without FIN
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 28 Oct 2026 14:34:42 +0000 (15:34 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 12 Nov 2026 16:31:21 +0000 (17:31 +0100)
commit2aed0c9bea4a61c0c58a1fc89f4fa98647fe0528
tree1e563117c5e8b59d7115ff696903a046e09049f7
parent14fa727d4435954bcf210482e1c40f366511c591
BUG/MINOR: h3: fix missing EOM after trailers without FIN

In HTTP/3, it is possible to receive a trailers frame without STREAM FIN
set. It is forbidden for the peer to emit any other HEADERS or DATA
frame, however it is possible to close the stream via an empty STREAM
FIN, or even using HTTP/3 extension frames which must be ignored by a
parser. In this case, EOT will be inserted without EOM flag. If it is
consumed by the stream layer prior to the final EOM reporting, a second
EOT will be inserted, resulting in an invalid message rejected by the
MUX from the other side.

To prevent this situation, disable EOT emission in case EOM cannot be
set. This is implemented via the new argument recently added to
http_trailers_to_htx().

Now that EOT trailers can be voluntarily delayed, it is necessary that
it will be inserted, which htx_set_eom() does not perform if the HTX
message is not empty. This could result with EOM set on the last HTX
headers block instead. Thus, HTTP/3 parser forces EOT emission when
trailers were already parsed, via a new argument on
qcs_http_handle_standalone_fin().

This must be backported up to 2.8. This relies on the previous
refactoring patch. Also note that http_trailers_to_htx() only exist in
master branch, as previously EOT block was added directly by h3 parser
in h3_trailers_to_htx().
include/haproxy/qcm_http.h
src/h3.c
src/hq_interop.c
src/qcm_http.c