]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: implement build options report
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 5 Dec 2024 15:14:08 +0000 (16:14 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 6 Dec 2024 17:34:10 +0000 (18:34 +0100)
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

index 61abda542d497766fd209e014881d14c052bcaab..7790571de89f46dde8ac8cdd619c13f4a292ee3e 100644 (file)
@@ -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