diff --git a/include/haproxy/connection-t.h b/include/haproxy/connection-t.h index 5e107222d..4222d3bd3 100644 --- a/include/haproxy/connection-t.h +++ b/include/haproxy/connection-t.h @@ -400,6 +400,7 @@ struct mux_ops { struct stconn *(*get_first_sc)(const struct connection *); /* retrieves any valid stconn from this connection */ void (*detach)(struct sedesc *); /* Detach an stconn from the stdesc from an outgoing connection, when the request is done */ int (*show_fd)(struct buffer *, struct connection *); /* append some data about connection into chunk for "show fd"; returns non-zero if suspicious */ + int (*show_sd)(struct buffer *, struct sedesc *, const char *pfx); /* append some data about the mux stream into chunk for "show sess"; returns non-zero if suspicious */ int (*subscribe)(struct stconn *sc, int event_type, struct wait_event *es); /* Subscribe to events, such as "being able to send" */ int (*unsubscribe)(struct stconn *sc, int event_type, struct wait_event *es); /* Unsubscribe from events */ int (*avail_streams)(struct connection *conn); /* Returns the number of streams still available for a connection */ diff --git a/src/stream.c b/src/stream.c index 49844c7f2..e268d68c6 100644 --- a/src/stream.c +++ b/src/stream.c @@ -3327,6 +3327,12 @@ static int stats_dump_full_strm_to_buffer(struct stconn *sc, struct stream *strm scf->sedesc->se, sc_ep_get(scf), scf->wait_event.events); if ((conn = sc_conn(scf)) != NULL) { + if (conn->mux && conn->mux->show_sd) { + chunk_appendf(&trash, " "); + conn->mux->show_sd(&trash, scf->sedesc, " "); + chunk_appendf(&trash, "\n"); + } + chunk_appendf(&trash, " co0=%p ctrl=%s xprt=%s mux=%s data=%s target=%s:%p\n", conn, @@ -3344,7 +3350,6 @@ static int stats_dump_full_strm_to_buffer(struct stconn *sc, struct stream *strm conn_fd(conn) >= 0 ? fdtab[conn->handle.fd].state : 0, conn_fd(conn) >= 0 ? !!(fdtab[conn->handle.fd].update_mask & ti->ltid_bit) : 0, conn_fd(conn) >= 0 ? fdtab[conn->handle.fd].thread_mask: 0); - } else if ((tmpctx = sc_appctx(scf)) != NULL) { chunk_appendf(&trash, @@ -3365,6 +3370,12 @@ static int stats_dump_full_strm_to_buffer(struct stconn *sc, struct stream *strm scb->sedesc->se, sc_ep_get(scb), scb->wait_event.events); if ((conn = sc_conn(scb)) != NULL) { + if (conn->mux && conn->mux->show_sd) { + chunk_appendf(&trash, " "); + conn->mux->show_sd(&trash, scb->sedesc, " "); + chunk_appendf(&trash, "\n"); + } + chunk_appendf(&trash, " co1=%p ctrl=%s xprt=%s mux=%s data=%s target=%s:%p\n", conn, @@ -3382,7 +3393,6 @@ static int stats_dump_full_strm_to_buffer(struct stconn *sc, struct stream *strm conn_fd(conn) >= 0 ? fdtab[conn->handle.fd].state : 0, conn_fd(conn) >= 0 ? !!(fdtab[conn->handle.fd].update_mask & ti->ltid_bit) : 0, conn_fd(conn) >= 0 ? fdtab[conn->handle.fd].thread_mask: 0); - } else if ((tmpctx = sc_appctx(scb)) != NULL) { chunk_appendf(&trash,