MINOR: protocol: register the receiver's I/O handler and not the protocol's
authorWilly Tarreau <w@1wt.eu>
Thu, 15 Oct 2020 19:29:49 +0000 (21:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 15 Oct 2020 19:47:56 +0000 (21:47 +0200)
commita74cb38e7cdac7b032ca3b91fb6c7aee1d41680f
tree83a8855f969ee61bf3c8daa4736b79f99785eefb
parente140a6921f345b8d25a1fa05c35d64c8be102655
MINOR: protocol: register the receiver's I/O handler and not the protocol's

Now we define a new sock_accept_iocb() for socket-based stream protocols
and use it as a wrapper for listener_accept() which now takes a listener
and not an FD anymore. This will allow the receiver's I/O cb to be
redefined during registration, and more specifically to get rid of the
hard-coded hacks in protocol_bind_all() made for syslog.

The previous ->accept() callback in the protocol was removed since it
doesn't have anything to do with accept() anymore but is more generic.
A few places where listener_accept() was compared against the FD's IO
callback for debugging purposes on the CLI were updated.
12 files changed:
include/haproxy/listener.h
include/haproxy/protocol-t.h
include/haproxy/sock.h
src/cli.c
src/haproxy.c
src/listener.c
src/mworker.c
src/proto_sockpair.c
src/proto_tcp.c
src/proto_uxst.c
src/protocol.c
src/sock.c