From: Amaury Denoyelle Date: Mon, 24 Nov 2025 14:00:24 +0000 (+0100) Subject: MINOR: quic: dump backend connections on show quic X-Git-Tag: v3.3.0~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e56fdf632050dd77da3c144a66542822d7665026;p=thirdparty%2Fhaproxy.git MINOR: quic: dump backend connections on show quic Add a new "be" filter to "show quic". Its purpose is to be able to display backend connections. These connections can also be listed using "all" filter. --- diff --git a/doc/management.txt b/doc/management.txt index be211b555..2e7416198 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -3343,9 +3343,9 @@ show quic [] [] The final argument is used to restrict or extend the connection list. By default, active frontend connections only are displayed. Use the extra - argument "clo" to list instead closing frontend connections, or "all" for - both. It's also possible to restrict to a single connection by specifying its - hexadecimal address. + argument "clo" to list instead closing frontend connections, "be" for backend + connections or "all" for every categories. It's also possible to restrict to + a single connection by specifying its hexadecimal address. show servers conn [] Dump the current and idle connections state of the servers belonging to the diff --git a/src/quic_cli.c b/src/quic_cli.c index f0bf407dd..e16067f9f 100644 --- a/src/quic_cli.c +++ b/src/quic_cli.c @@ -41,6 +41,7 @@ struct show_quic_ctx { #define QC_CLI_FL_SHOW_ALL 0x0001 /* show closing/draining connections */ #define QC_CLI_FL_SHOW_CLO 0x0002 /* show closing/draining connections */ +#define QC_CLI_FL_SHOW_BE 0x0004 /* show closing/draining connections */ /* Returns the output format for show quic. If specified explicitly use it as * set. Else format depends if filtering on a single connection instance. If @@ -96,6 +97,7 @@ static int cli_parse_show_quic(char **args, char *payload, struct appctx *appctx "Available output filters:\n" " all dump all connections\n" " clo dump frontend closing connections\n" + " be dump backend connections\n" " dump only the connection matching this identifier (0x...)\n" "Without any argument, active frontend connections are dumped using the oneline format.\n"); return cli_err(appctx, trash.area); @@ -167,6 +169,9 @@ static int cli_parse_show_quic(char **args, char *payload, struct appctx *appctx else if (istmatch(istarg, ist("clo"))) { ctx->flags |= QC_CLI_FL_SHOW_CLO; } + else if (istmatch(istarg, ist("be"))) { + ctx->flags |= QC_CLI_FL_SHOW_BE; + } else { cli_err(appctx, "Invalid argument, use 'help' for more options.\n"); return 1; @@ -441,7 +446,9 @@ static void dump_quic_full(struct show_quic_ctx *ctx, struct quic_conn *qc) static inline struct list *cli_quic_get_list(int flags, int thr) { - if (flags & QC_CLI_FL_SHOW_CLO) + if (flags & QC_CLI_FL_SHOW_BE) + return &ha_thread_ctx[thr].quic_conns_be; + else if (flags & QC_CLI_FL_SHOW_CLO) return &ha_thread_ctx[thr].quic_conns_clo; else return &ha_thread_ctx[thr].quic_conns_fe; @@ -500,6 +507,8 @@ static int cli_io_handler_dump_quic(struct appctx *appctx) } else if ((ctx->flags & QC_CLI_FL_SHOW_ALL) || ctx->ptr) { if (ctx->bref.ref == &ha_thread_ctx[ctx->thr].quic_conns_fe) + qc_list = &ha_thread_ctx[ctx->thr].quic_conns_be; + else if (ctx->bref.ref == &ha_thread_ctx[ctx->thr].quic_conns_be) qc_list = &ha_thread_ctx[ctx->thr].quic_conns_clo; ctx->bref.ref = qc_list->n; continue;