diff --git a/include/haproxy/filters-t.h b/include/haproxy/filters-t.h index 19658d847..f5a49856b 100644 --- a/include/haproxy/filters-t.h +++ b/include/haproxy/filters-t.h @@ -207,6 +207,7 @@ struct flt_ops { * 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 */ diff --git a/src/filters.c b/src/filters.c index 20f965e06..61fcc8fe2 100644 --- a/src/filters.c +++ b/src/filters.c @@ -249,6 +249,8 @@ parse_filter(char **args, int section_type, struct proxy *curpx, 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).", diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c index ea9adddc9..6e15cb7e9 100644 --- a/src/flt_http_comp.c +++ b/src/flt_http_comp.c @@ -1033,6 +1033,7 @@ parse_http_comp_flt(char **args, int *cur_arg, struct proxy *px, } fconf->id = http_comp_req_flt_id; + fconf->name = "comp-req"; fconf->conf = NULL; fconf->ops = &comp_req_ops; @@ -1048,6 +1049,7 @@ parse_http_comp_flt(char **args, int *cur_arg, struct proxy *px, 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;