flt_conf struct stores the filter id, which is used internally to check
match the filter against static pointer identifier, and also used as
descriptive text to describe the filter. But the id is not consistent
with the public name as used in the configuration (for instance when
selecting filter through the 'filter' directive).
What we do in this patch is that we add flt_conf->name member, which
stores the real filter name as seen in the configuration. This will
allow to select filters by their name from other directives in the
configuration.
* accessible from a filter when instantiated in a stream
*/
struct flt_conf {
+ const char *name; /* The filter name (same name used to select the filter from config) */
const char *id; /* The filter id */
struct flt_ops *ops; /* The filter callbacks */
void *conf; /* The filter configuration */
cur_arg = 1;
kw = flt_find_kw(args[cur_arg]);
if (kw) {
+ /* default name is keyword name, unless overriden by parse func */
+ fconf->name = kw->kw;
if (!kw->parse) {
memprintf(err, "parsing [%s:%d] : '%s' : "
"'%s' option is not implemented in this version (check build options).",
}
fconf->id = http_comp_req_flt_id;
+ fconf->name = "comp-req";
fconf->conf = NULL;
fconf->ops = &comp_req_ops;
return -1;
}
fconf_res->id = http_comp_res_flt_id;
+ fconf_res->name = "comp-res";
fconf_res->conf = NULL;
fconf_res->ops = &comp_res_ops;