]> git.kaiwu.me - haproxy.git/commit
MINOR: quic: use server cache for ALPN on BE side
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 3 Mar 2026 09:02:39 +0000 (10:02 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 3 Mar 2026 15:23:03 +0000 (16:23 +0100)
commitb1441c64404351366edc255c635ec378d5d2e78e
tree7623ca05a1a2a0f4f3851a77e97d145e2819401a
parent940e1820f6f3138f3d03a6e4167059b3772f18cc
MINOR: quic: use server cache for ALPN on BE side

On the backend side, QUIC MUX may be started preemptively before the
ALPN negotiation. This is useful notably for 0-RTT implementation.

However, this was a source of crashes. ALPN was expected to be retrieved
from the server cache, however QUIC MUX still used the ALPN from the
transport layer. This could cause a crash, especially when several
connections runs in parallel as the server cache is shared among
threads.

Thanks to the previous patch which reworks QUIC MUX init, this solution
can now be fixed. Indeed, if conn_get_alpn() is not successful, MUX can
look at the server cache again to use the expected value.

Note that this could still prevent the MUX to work as expected if the
server cache is resetted between connect_server() and MUX init. Thus,
the ultimate solution would be to copy the cached ALPN into the
connection. This problem is not specific to QUIC though, and must be
fixed in a separate patch.
src/mux_quic.c
src/xprt_quic.c