From: Christopher Faulet Date: Tue, 14 Mar 2023 14:48:06 +0000 (+0100) Subject: DEBUG: cli/show_fd: Display connection error code X-Git-Tag: v2.8-dev6~63 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d52f2ad6ee519ad272c6084089d8d853cefed788;p=thirdparty%2Fhaproxy.git DEBUG: cli/show_fd: Display connection error code When FD are dumps, the connection error code is now displayed. This may help to diagnose why a connection error occurred. This patch may be backported to help debugging. --- diff --git a/src/cli.c b/src/cli.c index b5de886128..e09ac692d4 100644 --- a/src/cli.c +++ b/src/cli.c @@ -1286,6 +1286,7 @@ static int cli_io_handler_show_fd(struct appctx *appctx) const void *ctx = NULL; const void *xprt_ctx = NULL; uint32_t conn_flags = 0; + uint8_t conn_err = 0; int is_back = 0; int suspicious = 0; @@ -1303,6 +1304,7 @@ static int cli_io_handler_show_fd(struct appctx *appctx) else if (fdt.iocb == sock_conn_iocb) { conn = (const struct connection *)fdt.owner; conn_flags = conn->flags; + conn_err = conn->err_code; mux = conn->mux; ctx = conn->ctx; xprt = conn->xprt; @@ -1352,7 +1354,7 @@ static int cli_io_handler_show_fd(struct appctx *appctx) chunk_appendf(&trash, ")"); } else if (fdt.iocb == sock_conn_iocb) { - chunk_appendf(&trash, ") back=%d cflg=0x%08x", is_back, conn_flags); + chunk_appendf(&trash, ") back=%d cflg=0x%08x cerr=%d", is_back, conn_flags, conn_err); if (conn->handle.fd != fd) { chunk_appendf(&trash, " fd=%d(BOGUS)", conn->handle.fd);