]> git.kaiwu.me - haproxy.git/commit
MINOR: filters: Pre-initialize the instances in check_config_validity()
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 28 Oct 2026 08:01:51 +0000 (09:01 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 28 Oct 2026 08:12:11 +0000 (09:12 +0100)
commit49726f3087760282228187eceee92b4381739551
treef7ff2a6323d0123cb7983a863ee22b2dd6cd2c64
parent922e1c8ba79beada0e2e6961d96f2fdb3bb76e99
MINOR: filters: Pre-initialize the instances in check_config_validity()

The filter instances were pre-checked by a callback registered at the
pre-check stage, flt_precheck_instances_all(). This was annoying for
the modules adding instances after the configuration parsing, from
their own pre-check callback: the pre-check callbacks run before
check_config_validity(), so the instances they add are never
finalized.

The pre-check of all instances now runs from check_config_validity(),
before the servers are initialized: the default filter mode is
applied, then every instance is finalized by the parse callback of its
class, and the filter-enable/filter-disable and filter-sequence
directives are applied, as before. The pre-check callbacks may add
instances when the whole configuration was parsed, they are then
pre-initialized like the ones declared by the configuration.

The functions are renamed accordingly: flt_precheck_instances_all()
becomes flt_preinit_instances_all(), now exported, and
flt_precheck_instances(), flt_precheck_class_instances() and
flt_precheck_instance() respectively become flt_preinit_instances(),
flt_preinit_class_instances() and flt_preinit_instance().
include/haproxy/filters.h
src/cfgparse.c
src/filters.c