]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Attach proxy QUIC stats counters to the QUIC connection
authorFrédéric Lécaille <flecaille@haproxy.com>
Thu, 19 May 2022 09:58:53 +0000 (11:58 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Fri, 20 May 2022 15:11:13 +0000 (17:11 +0200)
Make usage of EXTRA_COUNTERS_GET() do to so from qc_new_conn().

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

index eb9406691fb7595db61345884575ea6bca693a9a..e259c3f963b716180925f79dcc06ca53df08fcef 100644 (file)
@@ -792,6 +792,7 @@ struct quic_conn {
 
        const struct qcc_app_ops *app_ops;
        unsigned int sendto_err;
+       struct quic_counters *prx_counters;
 };
 
 #endif /* USE_QUIC */
index 5c9b7f2ce47900491614a2de93422322efe03789..e8082acba2e0f416d7237dc2b1a9869df538cab7 100644 (file)
@@ -45,6 +45,7 @@
 #include <haproxy/quic_frame.h>
 #include <haproxy/quic_loss.h>
 #include <haproxy/quic_sock.h>
+#include <haproxy/quic_stats-t.h>
 #include <haproxy/quic_stream.h>
 #include <haproxy/cbuf.h>
 #include <haproxy/proto_quic.h>
@@ -4330,8 +4331,13 @@ static struct quic_conn *qc_new_conn(unsigned int version, int ipv4,
        qc->cids = EB_ROOT;
        /* QUIC Server (or listener). */
        if (server) {
+               struct proxy *prx;
+
                l = owner;
+               prx = l->bind_conf->frontend;
 
+               qc->prx_counters = EXTRA_COUNTERS_GET(prx->extra_counters_fe,
+                                                     &quic_stats_module);
                qc->flags |= QUIC_FL_CONN_LISTENER;
                qc->state = QUIC_HS_ST_SERVER_INITIAL;
                /* Copy the initial DCID with the address. */