The "filter" directive declares a legacy filter configuration on the
proxy being parsed, which selects the legacy filter mode: the
PR_FL_FILTER_LEGACY flag is set on the proxy. Until now the flag was set
at the end of the parsing, after the filter keyword was resolved and its
configuration produced.
The filter keyword parsers may call flt_find_conf() to resolve a
previously declared configuration, or may add an implicit instance with
flt_add_implicit_instance(). Both rely on the filter mode of the proxy
to walk the right configuration list: without the flag they would
inspect the filter instances instead of the legacy filter
configurations. The keyword parser of a filter is called while the
directive is being parsed, so the mode must be known before, not after.
The flag is now set as soon as the "filter" directive is identified, so
the keyword parsers always see the mode their own directive selects.
struct flt_kw *kw;
int cur_arg;
+ curpx->flags |= PR_FL_FILTER_LEGACY;
if (!*args[1]) {
memprintf(err,
"parsing [%s:%d] : missing argument for '%s' in %s '%s'.",
goto error;
}
- curpx->flags |= PR_FL_FILTER_LEGACY;
fconf->flags |= FLT_CFG_FL_EXPLICIT;
flt_conf_add(curpx, fconf);
}