MINOR: h3: use correct error code for missing SETTINGS
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 28 Nov 2023 15:01:38 +0000 (16:01 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 29 Nov 2023 08:24:20 +0000 (09:24 +0100)
commit263f4e3d9cffbe22716db817a09c416d5c82f6fa
tree8fc5e0d57a0723f29b3bd3aadf2a8700a1dd9b5f
parent74ba22b1eeaeb96b74d3a4f7abdead88e9b4f413
MINOR: h3: use correct error code for missing SETTINGS

Each received HTTP/3 frame is checked to ensure it is valid given the
type of stream and its current status. This was implemented via
h3_is_frame_valid().

Previously, no distinction was made for error code, so every failure
triggered a CONNECTION_CLOSE_APP with code H3_FRAME_UNEXPECTED. However,
this function also ensures that the first frame received on control
frame is of type SETTINGS. If not, the error code to use is
H3_MISSING_SETTINGS.

To support this, adjust the function prototype. Instead of returning a
boolean, 0 is returned for success, or a HTTP/3 error code. The function
is renamed h3_check_frame_valid() to reflects the return type change.

This is not considered as a bug as previously the connection was
correctly closed on a missing SETTINGS, albeit with a non conform error
code. It's not deemed as sufficient to be backported.
src/h3.c