]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux: add a "show_fd" function to dump debugging information for "show fd"
authorWilly Tarreau <w@1wt.eu>
Fri, 30 Mar 2018 12:41:19 +0000 (14:41 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 30 Mar 2018 12:41:19 +0000 (14:41 +0200)
This function will be called from the CLI's "show fd" command to append some
extra mux-specific information that only the mux handler can decode. This is
supposed to help collect various hints about what is happening when facing
certain anomalies.

include/types/connection.h
src/cli.c

index cea61f55975979eed58fb430de002c4eb994e50b..3dab54e902e7d1150b6923126f3b7cafe45aa0c3 100644 (file)
@@ -306,6 +306,7 @@ struct mux_ops {
 
        struct conn_stream *(*attach)(struct connection *); /* Create and attach a conn_stream to an outgoing connection */
        void (*detach)(struct conn_stream *); /* Detach a conn_stream from an outgoing connection, when the request is done */
+       void (*show_fd)(struct chunk *, struct connection *); /* append some data about connection into chunk for "show fd" */
        unsigned int flags;                           /* some flags characterizing the mux's capabilities (MX_FL_*) */
        char name[8];                                 /* mux layer name, zero-terminated */
 };
index b7d428d8a73a3e0a801c77c195dc297a73033293..035f4e5a8baa52cf38ea39957c7b1033d6eac094 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -834,8 +834,11 @@ static int cli_io_handler_show_fd(struct appctx *appctx)
                        else if (li)
                                chunk_appendf(&trash, " fe=%s", li->bind_conf->frontend->id);
 
-                       if (mux)
+                       if (mux) {
                                chunk_appendf(&trash, " mux=%s mux_ctx=%p", mux->name, ctx);
+                               if (mux->show_fd)
+                                       mux->show_fd(&trash, fdt.owner);
+                       }
                        else
                                chunk_appendf(&trash, " nomux");
                }