From: Willy Tarreau Date: Tue, 10 Nov 2026 10:18:01 +0000 (+0100) Subject: MINOR: mux-quic: add an sctl() callback to the application ops X-Git-Tag: v3.5-dev12~5 X-Git-Url: https://git.kaiwu.me/%7B@url%7D?a=commitdiff_plain;h=9319d597ca67b63f48e270fd3c5e25dafcba39d3;p=haproxy.git MINOR: mux-quic: add an sctl() callback to the application ops 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. --- diff --git a/include/haproxy/mux_quic-t.h b/include/haproxy/mux_quic-t.h index 7ec467386..98f497167 100644 --- a/include/haproxy/mux_quic-t.h +++ b/include/haproxy/mux_quic-t.h @@ -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 */ diff --git a/src/h3.c b/src/h3.c index 071d56295..323952162 100644 --- 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 , called by the QUIC mux for + * the mux_sctl_type values it does not handle itself. 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, };