From: Amaury Denoyelle Date: Thu, 5 Dec 2024 15:14:08 +0000 (+0100) Subject: MINOR: quic: implement build options report X-Git-Tag: v3.2-dev1~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc0bb6224c608862b31bc784da9b7fc1fa5f3322;p=thirdparty%2Fhaproxy.git 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 --- diff --git a/src/proto_quic.c b/src/proto_quic.c index 61abda542d..7790571de8 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