mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-25 12:28:01 +00:00
MINOR: cli: make "show fd" report the mux and mux_ctx pointers when available
This is handy to quickly distinguish H2 connections as well as to easily access the h2c context. It could be backported to 1.8 to help during troubleshooting sessions.
This commit is contained in:
parent
4037a3f904
commit
35b1b48c75
@ -777,6 +777,8 @@ static int cli_io_handler_show_fd(struct appctx *appctx)
|
|||||||
struct listener *li = NULL;
|
struct listener *li = NULL;
|
||||||
struct server *sv = NULL;
|
struct server *sv = NULL;
|
||||||
struct proxy *px = NULL;
|
struct proxy *px = NULL;
|
||||||
|
struct mux_ops *mux = NULL;
|
||||||
|
void *ctx = NULL;
|
||||||
uint32_t conn_flags = 0;
|
uint32_t conn_flags = 0;
|
||||||
|
|
||||||
fdt = fdtab[fd];
|
fdt = fdtab[fd];
|
||||||
@ -786,6 +788,8 @@ static int cli_io_handler_show_fd(struct appctx *appctx)
|
|||||||
|
|
||||||
if (fdt.iocb == conn_fd_handler) {
|
if (fdt.iocb == conn_fd_handler) {
|
||||||
conn_flags = ((struct connection *)fdt.owner)->flags;
|
conn_flags = ((struct connection *)fdt.owner)->flags;
|
||||||
|
mux = ((struct connection *)fdt.owner)->mux;
|
||||||
|
ctx = ((struct connection *)fdt.owner)->mux_ctx;
|
||||||
li = objt_listener(((struct connection *)fdt.owner)->target);
|
li = objt_listener(((struct connection *)fdt.owner)->target);
|
||||||
sv = objt_server(((struct connection *)fdt.owner)->target);
|
sv = objt_server(((struct connection *)fdt.owner)->target);
|
||||||
px = objt_proxy(((struct connection *)fdt.owner)->target);
|
px = objt_proxy(((struct connection *)fdt.owner)->target);
|
||||||
@ -829,6 +833,11 @@ static int cli_io_handler_show_fd(struct appctx *appctx)
|
|||||||
chunk_appendf(&trash, " sv=%s/%s", sv->id, sv->proxy->id);
|
chunk_appendf(&trash, " sv=%s/%s", sv->id, sv->proxy->id);
|
||||||
else if (li)
|
else if (li)
|
||||||
chunk_appendf(&trash, " fe=%s", li->bind_conf->frontend->id);
|
chunk_appendf(&trash, " fe=%s", li->bind_conf->frontend->id);
|
||||||
|
|
||||||
|
if (mux)
|
||||||
|
chunk_appendf(&trash, " mux=%s mux_ctx=%p", mux->name, ctx);
|
||||||
|
else
|
||||||
|
chunk_appendf(&trash, " nomux");
|
||||||
}
|
}
|
||||||
else if (fdt.iocb == listener_accept) {
|
else if (fdt.iocb == listener_accept) {
|
||||||
chunk_appendf(&trash, " l.st=%s fe=%s",
|
chunk_appendf(&trash, " l.st=%s fe=%s",
|
||||||
|
Loading…
Reference in New Issue
Block a user