]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tevt/muxes: Add CTL and SCTL command to get the termination event logs
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 23 Dec 2024 13:56:33 +0000 (14:56 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 31 Jan 2025 09:41:50 +0000 (10:41 +0100)
MUX_CTL_TEVTS command is added to get the termination event logs of a mux
connection and MUX_SCTL_TEVTS command to get the termination event logs of a
mux stream.

include/haproxy/connection-t.h
src/mux_h1.c
src/mux_h2.c

index f113f0d1368650cfc660446d06730bd6a2cb437e..b1c8d94bd8069934c404f655a16fcbbe3b976dce 100644 (file)
@@ -339,12 +339,14 @@ enum mux_ctl_type {
        MUX_CTL_GET_GLITCHES, /* returns number of glitches on the connection */
        MUX_CTL_GET_NBSTRM, /* Return the current number of streams on the connection */
        MUX_CTL_GET_MAXSTRM, /* Return the max number of streams supported by the connection */
+       MUX_CTL_TEVTS, /* Return the termination events log of the mux connection */
 };
 
 /* sctl command used by mux->sctl() */
 enum mux_sctl_type {
        MUX_SCTL_SID, /* Return the mux stream ID as output, as a signed 64bits integer */
        MUX_SCTL_DBG_STR,    /* takes a mux_sctl_dbg_str_ctx argument, reads flags and returns debug info */
+       MUX_SCTL_TEVTS, /* Return the termination events log of the mux stream */
 };
 
 #define MUX_SCTL_DBG_STR_L_MUXS  0x00000001  // info from mux stream
index 3c86a8547213cd5c18ce563ebbce1c82558eb9f7..1ef9c3093d02408b40b15e623f8b8578b08befe7 100644 (file)
@@ -5262,6 +5262,8 @@ static int h1_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *outp
                return h1_used_streams(conn);
        case MUX_CTL_GET_MAXSTRM:
                return 1;
+       case MUX_CTL_TEVTS:
+               return h1c->term_evts_log;
        default:
                return -1;
        }
@@ -5297,6 +5299,8 @@ static int h1_sctl(struct stconn *sc, enum mux_sctl_type mux_sctl, void *output)
                /* other layers not implemented */
                dbg_ctx->ret.buf = *buf;
                return ret;
+       case MUX_SCTL_TEVTS:
+               return h1s->sd->term_evts_log;
        default:
                return -1;
        }
index 8c3805d64f4a7b022bc762633c1f488d1ba6f99e..4dad17c37d352e0d728137d2638c15da2171ac32 100644 (file)
@@ -5244,6 +5244,9 @@ static int h2_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *outp
        case MUX_CTL_GET_MAXSTRM:
                return h2c->streams_limit;
 
+       case MUX_CTL_TEVTS:
+               return h2c->term_evts_log;
+
        default:
                return -1;
        }
@@ -5279,6 +5282,8 @@ static int h2_sctl(struct stconn *sc, enum mux_sctl_type mux_sctl, void *output)
                /* other layers not implemented */
                dbg_ctx->ret.buf = *buf;
                return ret;
+       case MUX_SCTL_TEVTS:
+               return h2s->sd->term_evts_log;
 
        default:
                return -1;