]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: Add .ctl callback function to get info about a mux connection
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 30 Apr 2024 14:12:31 +0000 (16:12 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 6 May 2024 20:00:00 +0000 (22:00 +0200)
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

index d9d059034c52ea63a5ac4896833af5e6e83d4d7d..4c12c7e1b19a2ead48b9854ebc5eb1ee736b90cf 100644 (file)
@@ -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,