mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-04 10:23:38 +02:00
This patch changes the handling of named defaults sections. Prior to this patch, every unreferenced defaults proxies were removed on post parsing. Now by default, these sections are kept after postparsing and only purged on deinit. The objective is to allow reusing them as base configuration for dynamic backends. To implement this, refcount of every still addressable named sections is incremented by one after parsing. This ensures that they won't be removed even if referencing proxies are removed at runtime. This is done via the new function proxy_ref_all_defaults(). To ensure defaults instances are still properly removed on deinit, the inverse operation is performed : refcount is decremented by one on every defaults sections via proxy_unref_all_defaults(). The original behavior can still be used by using the new global keyword tune.defaults.purge. This is useful for users using configuration with large number of defaults and not interested in dynamic backends creation.