]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: proxy: only take defaults when a default proxy is passed.
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Feb 2021 08:15:16 +0000 (09:15 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Feb 2021 15:23:46 +0000 (16:23 +0100)
commit3b06eaec8659d24aebe653e02bbdf1084e6dfd32
tree51f0868c56fe2c45ac8e6d5a279cdc427d686683
parent7683893c70a4dfee4fce8c61641aeafd6fee628e
MEDIUM: proxy: only take defaults when a default proxy is passed.

The proxy initialization code relies on three phases, allocation,
pre-initialization, and assignments from defaults. This last part is
entirely taken from the defaults proxy when arguments are set. This
sensibly complexifies the initialization code as it requires to always
have a default proxy.

This patch instead first applies the original default settings on a
proxy, and then uses those from a default proxy only if one such is
used. This will allow to initialize a proxy out of any default proxy
while still using valid defaults. A careful inspection of the function
showed that only 4 fields used to be set regardless of the default
proxy, and those were moved to init_new_proxy() where they ought to
have been in the first place.
src/proxy.c