]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic-be: QUIC backend XPRT and transport parameters init during parsing
authorFrederic Lecaille <flecaille@haproxy.com>
Mon, 18 Dec 2023 10:18:45 +0000 (11:18 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 11 Jun 2025 16:37:34 +0000 (18:37 +0200)
Add ->quic_params new member to server struct.
Also set the ->xprt member of the server being initialized and initialize asap its
transport parameters from _srv_parse_init().

include/haproxy/server-t.h
src/server.c

index dc238ec255aa6618d124ce98d6f9201706fafee5..91ce6f37c77040d9ff0f1a3861801cccfb6ea111 100644 (file)
@@ -478,6 +478,9 @@ struct server {
                char *alpn_str;                 /* ALPN protocol string */
                int alpn_len;                   /* ALPN protocol string length */
        } ssl_ctx;
+#ifdef USE_QUIC
+       struct quic_transport_params quic_params; /* QUIC transport parameters */
+#endif
        struct resolv_srvrq *srvrq;             /* Pointer representing the DNS SRV requeest, if any */
        struct list srv_rec_item;               /* to attach server to a srv record item */
        struct list ip_rec_item;                /* to attach server to a A or AAAA record item */
index 4d7d1f0d824637584c6fa591eee24d0677479427..39d798ec4e58b2e82fd78b1db92df3e82efa51eb 100644 (file)
@@ -37,6 +37,7 @@
 #include <haproxy/protocol.h>
 #include <haproxy/proxy.h>
 #include <haproxy/queue.h>
+#include <haproxy/quic_tp.h>
 #include <haproxy/resolvers.h>
 #include <haproxy/sample.h>
 #include <haproxy/sc_strm.h>
@@ -3589,6 +3590,7 @@ static int _srv_parse_init(struct server **srv, char **args, int *cur_arg,
                                  (parse_flags & SRV_PARSE_INITIAL_RESOLVE ? PA_O_RESOLVE : 0) | PA_O_PORT_OK |
                                  (parse_flags & SRV_PARSE_IN_PEER_SECTION ? PA_O_PORT_MAND : PA_O_PORT_OFS) |
                                  PA_O_STREAM | PA_O_DGRAM | PA_O_XPRT);
+
                if (!sk) {
                        ha_alert("%s\n", errmsg);
                        err_code |= ERR_ALERT | ERR_FATAL;
@@ -3605,6 +3607,9 @@ static int _srv_parse_init(struct server **srv, char **args, int *cur_arg,
                                err_code |= ERR_ALERT | ERR_FATAL;
                                goto out;
                        }
+
+                       newsrv->xprt = xprt_get(XPRT_QUIC);
+                       quic_transport_params_init(&newsrv->quic_params, 0);
                }
 #endif