MINOR: listener: now use a generic add_listener() function
authorWilly Tarreau <w@1wt.eu>
Fri, 4 Dec 2020 14:03:36 +0000 (15:03 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 14 Dec 2020 08:29:12 +0000 (09:29 +0100)
commitefcf138b057d7a0d66526172764e6a9e4a3c5901
treeb1c54be241bd987b0babbf643da6655151dff96a
parentd7c746e156649125666f83250193eec7e6e92829
MINOR: listener: now use a generic add_listener() function

With the removal of the family-specific port setting, all protocol had
exactly the same implementation of ->add(). A generic one was created
with the name "default_add_listener" so that all other ones can now be
removed. The API was slightly adjusted so that the protocol and the
listener are passed instead of the listener and the port.

Note that all protocols continue to provide this ->add() method instead
of routinely calling default_add_listener() from create_listeners(). This
makes sure that any non-standard protocol will still be able to intercept
the listener addition if needed.

This could be backported to 2.3 along with the few previous patches on
listners as a pure code cleanup.

(cherry picked from commit d1f250f87b8850f24456e62140509e612f8b3415)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/listener.h
include/haproxy/protocol-t.h
src/listener.c
src/proto_sockpair.c
src/proto_tcp.c
src/proto_udp.c
src/proto_uxst.c