BUG/MEDIUM: server: do not auto insert a dynamic server in px addr_node
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 8 Jun 2021 13:19:51 +0000 (15:19 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 15 Jun 2021 09:42:53 +0000 (11:42 +0200)
commit8ff0434b61d44e8c62f00744ebf7bfb0b76b15c0
tree45e96f225b1d1ec6fec6d469a1cbe51923643506
parent1613b4a75de04f110b7d5a09c1aebbf621c3811c
BUG/MEDIUM: server: do not auto insert a dynamic server in px addr_node

Until then, the servers were automatically attached on their creation
into the proxy addr_node tree via _srv_parse_init. In case of an invalid
dynamic server which is instantly freed, no detach operation was made
leaving a NULL server in the tree.

Change this mode of operation by marking the attach operation as
optional in _srv_parse_init. This operation is not conduct for a dynamic
server. The server is attached only at the end of the CLI handler when
it is marked as valid.

This must be backported up to 2.4.
src/server.c