1
0
mirror of http://git.haproxy.org/git/haproxy.git/ synced 2025-04-21 06:25:43 +00:00
haproxy/contrib/debug
Willy Tarreau 616c1cf774 CONTRIB: debug: add new program "poll" to test poll() events
This simple program prepares a TCP connection between two ends and
allows to perform various operations on them such as send, recv, poll,
shutdown, close, reset, etc. It takes care of remaining particularly
silent to help inspection via strace, though it can also be verbose
and report status, errno, and poll events. It delays acceptation of
the incoming server-side connection so that it's even possible to
test the poll status on a listener with a pending connection, or
to close the connection without accepting it and inspect the effect
on the client.

Actions are executed in the command line order as they are parsed,
they may be grouped using commas when they are performed on the same
socket.

Example showing a successful recv() of pending data before a pending error:
   $ ./poll -v -l pol,acc,pol -c snd,shw -s pol,rcv,pol,rcv,pol,snd,lin,clo -c pol,rcv,pol,rcv,pol

   #### BEGIN ####
   cmd  stp : do_pol(3): ret=1 ev=0x1 (IN)
   cmd  stp : do_acc(3): ret=5
   cmd  stp : do_pol(3): ret=0 ev=0
   cmd  stp : do_snd(4): ret=3
   cmd  stp : do_shw(4): ret=0
   cmd  stp : do_pol(5): ret=1 ev=0x2005 (IN OUT RDHUP)
   cmd  stp : do_rcv(5): ret=3
   cmd  stp : do_pol(5): ret=1 ev=0x2005 (IN OUT RDHUP)
   cmd  stp : do_rcv(5): ret=0
   cmd  stp : do_pol(5): ret=1 ev=0x2005 (IN OUT RDHUP)
   cmd  stp : do_snd(5): ret=3
   cmd  stp : do_lin(5): ret=0
   cmd  stp : do_clo(5): ret=0
   cmd  stp : do_pol(4): ret=1 ev=0x201d (IN OUT ERR HUP RDHUP)
   cmd  stp : do_rcv(4): ret=3
   cmd  stp : do_pol(4): ret=1 ev=0x201d (IN OUT ERR HUP RDHUP)
   cmd  stp : do_rcv(4): ret=-1 (Connection reset by peer)
   cmd  stp : do_pol(4): ret=1 ev=0x2015 (IN OUT HUP RDHUP)
   #### END ####
2019-09-05 09:31:18 +02:00
..
flags.c BUG/MINOR: debug: Remove flags CO_FL_SOCK_WR_ENA/CO_FL_SOCK_RD_ENA 2019-07-19 09:24:12 +02:00
Makefile CONTRIB: debug: add new program "poll" to test poll() events 2019-09-05 09:31:18 +02:00
poll.c CONTRIB: debug: add new program "poll" to test poll() events 2019-09-05 09:31:18 +02:00