MEDIUM: proxy: store the default proxies in a tree by name
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Feb 2021 13:08:31 +0000 (14:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Feb 2021 15:23:46 +0000 (16:23 +0100)
commite90904d5a9537332e63f2f27828f360aa0c1b57f
treefb7d92da9a301d8153fcaf2588f0e58c1e9ca8ea
parent0a0f6a7e4f6536d80f072263a2484acbe11a6e6c
MEDIUM: proxy: store the default proxies in a tree by name

Now default proxies are stored into a dedicated tree, sorted by name.
Only unnamed entries are not kept upon new section creation. The very
first call to cfg_parse_listen() will automatically allocate a dummy
defaults section which corresponds to the previous static one, since
the code requires to have one at a few places.

The first immediately visible benefit is that it allows to reuse
alloc_new_proxy() to allocate a defaults section instead of doing it by
hand. And the secret goal is to allow to keep multiple named defaults
section in memory to reuse them from various proxies.
include/haproxy/proxy.h
src/cfgparse-listen.c
src/haproxy.c
src/proxy.c