MINOR: protocol: add a set of ctrl_init/ctrl_close methods for setup/teardown
authorWilly Tarreau <w@1wt.eu>
Tue, 8 Dec 2020 14:50:56 +0000 (15:50 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 8 Dec 2020 14:50:56 +0000 (15:50 +0100)
commitde471c46555fb0517103165c9582f83b891ea47f
treebd5383fc90d484065606061fb1e840258cefb20f
parentb366c9a59abdb8993af5581749e5550da5af3f37
MINOR: protocol: add a set of ctrl_init/ctrl_close methods for setup/teardown

Currnetly conn_ctrl_init() does an fd_insert() and conn_ctrl_close() does an
fd_delete(). These are the two only short-term obstacles against using a
non-fd handle to set up a connection. Let's have pur these into the protocol
layer, along with the other connection-level stuff so that the generic
connection code uses them instead. This will allow to define new ones for
other protocols (e.g. QUIC).

Since we only support regular sockets at the moment, the code was placed
into sock.c and shared with proto_tcp, proto_uxst and proto_sockpair.
include/haproxy/protocol-t.h
include/haproxy/sock.h
src/proto_sockpair.c
src/proto_tcp.c
src/proto_uxst.c
src/sock.c