From: Amaury Denoyelle Date: Wed, 1 Feb 2023 16:05:36 +0000 (+0100) Subject: MINOR: quic: display Tx stream info on "show quic" X-Git-Tag: v2.8-dev4~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2eda63b447b88ebd34b416b1bff256a9c3c968a4;p=thirdparty%2Fhaproxy.git MINOR: quic: display Tx stream info on "show quic" Complete "show quic" handler by displaying information about quic_stream_desc entries. These structures are used to emit stream data and store them until acknowledgment is received. This should be backported up to 2.7. --- diff --git a/src/quic_conn.c b/src/quic_conn.c index 94a7cfaff1..a7712800b0 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -7647,6 +7647,8 @@ static int cli_io_handler_dump_quic(struct appctx *appctx) struct stconn *sc = appctx_sc(appctx); struct quic_conn *qc; struct quic_enc_level *qel; + struct eb64_node *node; + struct qc_stream_desc *stream; char bufaddr[INET6_ADDRSTRLEN], bufport[6]; int expire; unsigned char cid_len; @@ -7678,6 +7680,7 @@ static int cli_io_handler_dump_quic(struct appctx *appctx) while (1) { int done = 0; + int i; if (ctx->bref.ref == &ha_thread_ctx[ctx->thr].quic_conns) { done = 1; @@ -7765,6 +7768,24 @@ static int cli_io_handler_dump_quic(struct appctx *appctx) chunk_appendf(&trash, "\n"); + /* Streams */ + node = eb64_first(&qc->streams_by_id); + i = 0; + while (node) { + stream = eb64_entry(node, struct qc_stream_desc, by_id); + node = eb64_next(node); + + chunk_appendf(&trash, " | stream=%-8llu", (long long unsigned int)stream->by_id.key); + chunk_appendf(&trash, " off=%-8lu ack=%-8lu", stream->buf_offset, stream->ack_offset); + + if (!(++i % 3)) { + chunk_appendf(&trash, "\n"); + i = 0; + } + } + + chunk_appendf(&trash, "\n"); + if (applet_putchk(appctx, &trash) == -1) { /* Register show_quic_ctx to quic_conn instance. */ LIST_APPEND(&qc->back_refs, &ctx->bref.users);