]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: mux-quic: add an sctl() callback to the application ops
authorWilly Tarreau <w@1wt.eu>
Tue, 10 Nov 2026 10:18:01 +0000 (11:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 12 Nov 2026 17:12:23 +0000 (18:12 +0100)
The QUIC mux will need to pass some stream controls to the application
layer, which holds information that the mux doesn't know about (e.g. the
HTTP hardening results of the H3 stream). This adds a new sctl() callback
to qcc_app_ops, which takes the qcs, the mux_sctl_type and an output
pointer, and works like mux->sctl(), returning -1 when not supported.

For now, h3_sctl() doesn't implement anything and the mux doesn't call it
yet.

include/haproxy/mux_quic-t.h
src/h3.c

index 7ec46738656e9f7317e80575565798b48f43a869..98f497167b8c7f254a2df8f712cea7249f3a88a7 100644 (file)
@@ -264,6 +264,12 @@ struct qcc_app_ops {
 
        /* Free function to close a stream after MUX layer shutdown. */
        int (*strm_reject)(struct list *out, uint64_t id);
+
+       /* Application-specific stream controls, called by the mux for the
+        * mux_sctl_type values it doesn't handle itself. Works like
+        * mux->sctl(): returns -1 if not supported.
+        */
+       int (*sctl)(struct qcs *qcs, enum mux_sctl_type mux_sctl, void *output);
 };
 
 #endif /* USE_QUIC */
index 071d5629546d5f7012d6b03f234cfb444de0f36c..323952162b8a10d0aaf3fd94f88cc726327b0152 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -3933,6 +3933,18 @@ static void h3_stats_inc_err_cnt(void *ctx, int err_code)
        h3_inc_err_cnt(h3c->prx_counters, err_code);
 }
 
+/* Application-specific stream controls for <qcs>, called by the QUIC mux for
+ * the mux_sctl_type values it does not handle itself. <output> depends on the
+ * request. Returns -1 when not supported.
+ */
+static int h3_sctl(struct qcs *qcs, enum mux_sctl_type mux_sctl, void *output)
+{
+       switch (mux_sctl) {
+       default:
+               return -1;
+       }
+}
+
 static void h3_report_susp(void *ctx)
 {
        struct h3c *h3c = ctx;
@@ -4056,4 +4068,5 @@ const struct qcc_app_ops h3_ops = {
        .report_susp = h3_report_susp,
        .release     = h3_release,
        .strm_reject = h3_reject,
+       .sctl        = h3_sctl,
 };