]> git.kaiwu.me - haproxy.git/commitdiff
CLEANUP: h3: reduce header dependency list
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 2 Dec 2026 15:06:23 +0000 (16:06 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 3 Dec 2026 10:49:20 +0000 (11:49 +0100)
Remove unneeded header include statements in H3 module. In particular,
quic_conn.h is no longer needed: this requires replacing the
qc_counters() call with dedicated code.

src/h3.c

index 35785db643ee724a36d901ffb43cc483cf1c9f4e..a7d37082790a708f8cb1dcc8c7b49c887e06793f 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <haproxy/h3.h>
+
 #include <import/ist.h>
 
 #include <haproxy/api.h>
 #include <haproxy/buf.h>
 #include <haproxy/chunk.h>
 #include <haproxy/connection.h>
+#include <haproxy/counters.h>
 #include <haproxy/dynbuf.h>
-#include <haproxy/h3.h>
 #include <haproxy/h3_stats.h>
 #include <haproxy/http.h>
 #include <haproxy/http-hdr-t.h>
 #include <haproxy/http_htx.h>
 #include <haproxy/htx.h>
 #include <haproxy/intops.h>
-#include <haproxy/istbuf.h>
 #include <haproxy/mux_quic.h>
 #include <haproxy/pool.h>
 #include <haproxy/qcm_http.h>
 #include <haproxy/qpack-dec.h>
 #include <haproxy/qpack-enc.h>
-#include <haproxy/quic_conn.h>
 #include <haproxy/quic_enc.h>
 #include <haproxy/quic_fctl.h>
 #include <haproxy/quic_frame.h>
@@ -3903,15 +3903,19 @@ static int h3_init(struct qcc *qcc)
        h3c->flags = 0;
        h3c->id_shut_l = 0;
        h3c->id_shut_r = 0;
+       h3c->prx_counters = NULL;
        h3c->hdng_prf = NULL;
 
        qcc->ctx = h3c;
-       h3c->prx_counters = qc_counters(qcc->conn->target, &h3_stats_module);
 
-       if (srv)
+       if (srv) {
+               h3c->prx_counters = EXTRA_COUNTERS_GET(srv->proxy->extra_counters_be, &h3_stats_module);
                h3c->hdng_prf = srv->hdng_prf;
-       else if (li)
+       }
+       else if (li) {
+               h3c->prx_counters = EXTRA_COUNTERS_GET(li->bind_conf->frontend->extra_counters_fe, &h3_stats_module);
                h3c->hdng_prf = li->bind_conf->hdng_prf;
+       }
 
        /* "auto": untrusted for non-local otherwise trusted */
        if (!h3c->hdng_prf) {