]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli: report the fd state in "show sess xxx"
authorWilly Tarreau <w@1wt.eu>
Mon, 19 Nov 2012 17:15:19 +0000 (18:15 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 19 Nov 2012 17:15:19 +0000 (18:15 +0100)
This is useful to check the FD polling state during debugging sessions.

src/dumpstats.c

index 35d75c0887c13a473299ecb0b20f589e3d247e88..268bec69bd4e5cf368090445223ba3e905b2cb09 100644 (file)
@@ -3506,7 +3506,7 @@ static int stats_dump_full_sess_to_buffer(struct stream_interface *si)
                             sess->si[1].err_type);
 
                chunk_appendf(&trash,
-                             "  lconn=%p (ctrl=%p(%s) xprt=%p(%s) data=%p(%s) fd=%d target=%d flags=0x%08x)\n",
+                             "  lconn=%p (ctrl=%p(%s) xprt=%p(%s) data=%p(%s) target=%d flags=0x%08x fd=%d fd_spec=%02x)\n",
                              sess->si[0].conn,
                              sess->si[0].conn->ctrl,
                              sess->si[0].conn->ctrl ? sess->si[0].conn->ctrl->name : "NONE",
@@ -3522,12 +3522,13 @@ static int stats_dump_full_sess_to_buffer(struct stream_interface *si)
                              (sess->si[0].conn->data == &sess_conn_cb) ? "SESS" :
                              (sess->si[0].conn->data == &si_conn_cb) ? "STRM" :
                              (sess->si[0].conn->data == &check_conn_cb) ? "CHCK" : "????",
-                             sess->si[0].conn->t.sock.fd,
                              sess->si[0].conn->target ? *sess->si[0].conn->target : 0,
-                             sess->si[0].conn->flags);
+                             sess->si[0].conn->flags,
+                             sess->si[0].conn->t.sock.fd,
+                             sess->si[0].conn->t.sock.fd >= 0 ? fdtab[sess->si[0].conn->t.sock.fd].spec_e : 0);
 
                chunk_appendf(&trash,
-                             "  rconn=%p (ctrl=%p(%s) xprt=%p(%s) data=%p(%s) fd=%d target=%d flags=0x%08x)\n",
+                             "  rconn=%p (ctrl=%p(%s) xprt=%p(%s) data=%p(%s) target=%d flags=0x%08x fd=%d fd_spec=%02x)\n",
                              sess->si[1].conn,
                              sess->si[1].conn->ctrl,
                              sess->si[1].conn->ctrl ? sess->si[1].conn->ctrl->name : "NONE",
@@ -3543,9 +3544,10 @@ static int stats_dump_full_sess_to_buffer(struct stream_interface *si)
                              (sess->si[1].conn->data == &sess_conn_cb) ? "SESS" :
                              (sess->si[1].conn->data == &si_conn_cb) ? "STRM" :
                              (sess->si[1].conn->data == &check_conn_cb) ? "CHCK" : "????",
-                             sess->si[1].conn->t.sock.fd,
                              sess->si[1].conn->target ? *sess->si[1].conn->target : 0,
-                             sess->si[1].conn->flags);
+                             sess->si[1].conn->flags,
+                             sess->si[1].conn->t.sock.fd,
+                             sess->si[1].conn->t.sock.fd >= 0 ? fdtab[sess->si[1].conn->t.sock.fd].spec_e : 0);
 
                chunk_appendf(&trash,
                             "  txn=%p (flags=0x%x meth=%d status=%d req.st=%d rsp.st=%d)\n",