]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli/show-fd: slightly reorganize the FD status flags
authorWilly Tarreau <w@1wt.eu>
Wed, 7 Apr 2021 06:48:12 +0000 (08:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 Apr 2021 16:18:37 +0000 (18:18 +0200)
Slightly reorder the status flags to better match their order in the
"state" field, and also decode the "shut" state which is particularly
useful and already part of this field.

src/cli.c

index 575a1730ea16756e6edf7ae278a984da355a6594..5f370147a5d93ccf502a130b10e318dd4cc85a7a 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -1190,20 +1190,22 @@ static int cli_io_handler_show_fd(struct appctx *appctx)
                        suspicious = 1;
 
                chunk_printf(&trash,
-                            "  %5d : st=0x%06x(R:%c%c W:%c%c %c%c%c%c%c %c%c) tmask=0x%lx umask=0x%lx owner=%p iocb=%p(",
+                            "  %5d : st=0x%06x(%c%c %c%c%c%c%c W:%c%c%c R:%c%c%c) tmask=0x%lx umask=0x%lx owner=%p iocb=%p(",
                             fd,
                             fdt.state,
-                            (fdt.state & FD_EV_READY_R)  ? 'R' : 'r',
-                            (fdt.state & FD_EV_ACTIVE_R) ? 'A' : 'a',
-                            (fdt.state & FD_EV_READY_W)  ? 'R' : 'r',
-                            (fdt.state & FD_EV_ACTIVE_W) ? 'A' : 'a',
+                            (fdt.state & FD_CLONED) ? 'C' : 'c',
+                            (fdt.state & FD_LINGER_RISK) ? 'L' : 'l',
                             (fdt.state & FD_POLL_HUP) ? 'H' : 'h',
                             (fdt.state & FD_POLL_ERR) ? 'E' : 'e',
                             (fdt.state & FD_POLL_OUT) ? 'O' : 'o',
                             (fdt.state & FD_POLL_PRI) ? 'P' : 'p',
                             (fdt.state & FD_POLL_IN)  ? 'I' : 'i',
-                            (fdt.state & FD_LINGER_RISK) ? 'L' : 'l',
-                            (fdt.state & FD_CLONED) ? 'C' : 'c',
+                            (fdt.state & FD_EV_SHUT_W) ? 'S' : 's',
+                            (fdt.state & FD_EV_READY_W)  ? 'R' : 'r',
+                            (fdt.state & FD_EV_ACTIVE_W) ? 'A' : 'a',
+                            (fdt.state & FD_EV_SHUT_R) ? 'S' : 's',
+                            (fdt.state & FD_EV_READY_R)  ? 'R' : 'r',
+                            (fdt.state & FD_EV_ACTIVE_R) ? 'A' : 'a',
                             fdt.thread_mask, fdt.update_mask,
                             fdt.owner,
                             fdt.iocb);