mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
MINOR: mux-quic: implement debug string for logs
Implement MUX_SCTL_DBG_STR for QUIC MUX. This returns info for the current QCS and QCC instances, reusing qmux_dump_qc{c,s}_info functions already used for traces, and the connection flags. This stream operation is useful for debug string sample support.
This commit is contained in:
parent
eb4dfa3b36
commit
630fa53c51
@ -3,6 +3,7 @@
|
||||
#include <import/eb64tree.h>
|
||||
|
||||
#include <haproxy/api.h>
|
||||
#include <haproxy/buf.h>
|
||||
#include <haproxy/chunk.h>
|
||||
#include <haproxy/connection.h>
|
||||
#include <haproxy/dynbuf.h>
|
||||
@ -3201,7 +3202,10 @@ static int qmux_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *ou
|
||||
static int qmux_sctl(struct stconn *sc, enum mux_sctl_type mux_sctl, void *output)
|
||||
{
|
||||
int ret = 0;
|
||||
struct qcs *qcs = __sc_mux_strm(sc);
|
||||
const struct qcs *qcs = __sc_mux_strm(sc);
|
||||
const struct qcc *qcc = qcs->qcc;
|
||||
union mux_sctl_dbg_str_ctx *dbg_ctx;
|
||||
struct buffer *buf;
|
||||
|
||||
switch (mux_sctl) {
|
||||
case MUX_SCTL_SID:
|
||||
@ -3209,6 +3213,22 @@ static int qmux_sctl(struct stconn *sc, enum mux_sctl_type mux_sctl, void *outpu
|
||||
*((int64_t *)output) = qcs->id;
|
||||
return ret;
|
||||
|
||||
case MUX_SCTL_DBG_STR:
|
||||
dbg_ctx = output;
|
||||
buf = get_trash_chunk();
|
||||
|
||||
if (dbg_ctx->arg.debug_flags & MUX_SCTL_DBG_STR_L_MUXS)
|
||||
qmux_dump_qcs_info(buf, qcs);
|
||||
|
||||
if (dbg_ctx->arg.debug_flags & MUX_SCTL_DBG_STR_L_MUXC)
|
||||
qmux_dump_qcc_info(buf, qcc);
|
||||
|
||||
if (dbg_ctx->arg.debug_flags & MUX_SCTL_DBG_STR_L_CONN)
|
||||
chunk_appendf(buf, " conn.flg=%#08x", qcc->conn->flags);
|
||||
|
||||
dbg_ctx->ret.buf = *buf;
|
||||
return ret;
|
||||
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user