From 12fb6d73cde5688c9ddfeb199e036be4828700a9 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 30 Apr 2024 16:12:31 +0200 Subject: [PATCH] MINOR: mux-quic: Add .ctl callback function to get info about a mux connection Other muxes implement this callback function. It was not implemented for the QUIC mux because it was useless. It will be used to retrieve the current/max number of stream for a quic connection. So let's added it, adding the default support for MUX_CTL_EXIT_STATUS command. --- src/mux_quic.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/mux_quic.c b/src/mux_quic.c index d9d059034..4c12c7e1b 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -3136,6 +3136,19 @@ static void qmux_strm_shut(struct stconn *sc, enum se_shut_mode mode, struct se_ TRACE_LEAVE(QMUX_EV_STRM_SHUT, qcc->conn, qcs); } +static int qmux_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *output) +{ + struct qcc *qcc = conn->ctx; + + switch (mux_ctl) { + case MUX_CTL_EXIT_STATUS: + return MUX_ES_UNKNOWN; + + default: + return -1; + } +} + static int qmux_sctl(struct stconn *sc, enum mux_sctl_type mux_sctl, void *output) { int ret = 0; @@ -3192,6 +3205,7 @@ static const struct mux_ops qmux_ops = { .unsubscribe = qmux_strm_unsubscribe, .wake = qmux_wake, .shut = qmux_strm_shut, + .ctl = qmux_ctl, .sctl = qmux_sctl, .show_sd = qmux_strm_show_sd, .flags = MX_FL_HTX|MX_FL_NO_UPG|MX_FL_FRAMED,