]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: listener: move the transport layer pointer to the bind_conf
authorWilly Tarreau <w@1wt.eu>
Wed, 21 Dec 2016 21:04:54 +0000 (22:04 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 22 Dec 2016 22:26:37 +0000 (23:26 +0100)
commit71a8c7c49e912f4c6117b62bdf24cbe21916c2ae
tree698937f5ad93c14cf864ae40aad6a45a03ed7b35
parent5820a3669031b2f4de58577953ed3135aaaa1f62
MINOR: listener: move the transport layer pointer to the bind_conf

A mistake was made when the socket layer was cut into proto and
transport, the transport was attached to the listener while all
listeners in a single "bind" line always have exactly the same
transport. It doesn't seem obvious but this is the reason why there
are so many #ifdefs USE_OPENSSL in cfgparse : a lot of operations
have to be open-coded because cfgparse only manipulates bind_conf
and we don't have the information of the transport layer here.

Very little code makes use of the transport layer, mainly session
setup and log. These places can afford an extra pointer indirection
(the listener points to the bind_conf). This change is thus very small,
it saves a little bit of memory (8B per listener) and makes the code
more flexible.
include/proto/listener.h
include/types/listener.h
src/cfgparse.c
src/cli.c
src/log.c
src/session.c
src/ssl_sock.c