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 b5de886..e09ac69 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -1286,6 +1286,7 @@
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 @@
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 @@
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);