From fc0bb6224c608862b31bc784da9b7fc1fa5f3322 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Thu, 5 Dec 2024 16:14:08 +0100 Subject: [PATCH] MINOR: quic: implement build options report Define a new function quic_register_build_options(). Its purpose is to register a build options string for QUIC features which is reported when using haproxy -vv. This will allow to easily determine if connection socket-owner mode and GSO are supported or not. Here is the new filtered output : $ ./haproxy -vv|grep '^QUIC:' QUIC: connection socket-owner mode support : yes QUIC: GSO emission support : yes --- src/proto_quic.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/proto_quic.c b/src/proto_quic.c index 61abda542..7790571de 100644 --- a/src/proto_quic.c +++ b/src/proto_quic.c @@ -835,6 +835,25 @@ static int quic_test_socketopts(void) } REGISTER_POST_CHECK(quic_test_socketopts); +static void quic_register_build_options(void) +{ + char *ptr = NULL; + int ret; + + ret = quic_test_conn_socket_owner(); + memprintf(&ptr, "QUIC: connection socket-owner mode support : "); + memprintf(&ptr, "%s%s\n", ptr, ret > 0 ? "yes" : + !ret ? "no" : "unknown"); + + ret = quic_test_gso(); + memprintf(&ptr, "%sQUIC: GSO emission support : ", ptr); + memprintf(&ptr, "%s%s", ptr, ret > 0 ? "yes" : + !ret ? "no" : "unknown"); + + hap_register_build_opts(ptr, 1); +} +INITCALL0(STG_REGISTER, quic_register_build_options); + /* * Local variables: * c-indent-level: 8