BUG/MEDIUM: quic: support wait-for-handshake
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 15 Oct 2024 15:37:00 +0000 (17:37 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 8 Nov 2024 14:54:11 +0000 (15:54 +0100)
commit05658956ae53e2d027ade7f237c64d79cffc1c4a
treedfbd9d5a79b6f702952fd1606ae01edc141edb17
parent35dbd3ea0fe991f5f42d240a5e3daa2fa5f6de9d
BUG/MEDIUM: quic: support wait-for-handshake

wait-for-handshake http-request action was completely ineffective with
QUIC protocol. This commit implements its support for QUIC.

QUIC MUX layer is extended to support wait-for-handshake. A new function
qcc_handle_wait_for_hs() is executed during qcc_io_process(). It detects
if MUX processing occurs after underlying QUIC handshake completion. If
this is the case, it indicates that early data may be received. As such,
connection is flagged with CO_FL_EARLY_SSL_HS, which is necessary to
block stream processing on wait-for-handshake action.

After this, qcc subscribs on quic_conn layer for RECV notification. This
is used to detect QUIC handshake completion. Thus,
qcc_handle_wait_for_hs() can be reexecuted one last time, to remove
CO_FL_EARLY_SSL_HS and notify every streams flagged as
SE_FL_WAIT_FOR_HS.

This patch must be backported up to 2.6, after a mandatory period of
observation. Note that it relies on the backport of the two previous
patches :
- MINOR: quic: notify connection layer on handshake completion
- BUG/MINOR: stream: unblock stream on wait-for-handshake completion

(cherry picked from commit 0918c41ef63964a986c627d20b8a1324de639cc2)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/mux_quic-t.h
src/mux_quic.c