From: Christopher Faulet Date: Tue, 27 Oct 2026 09:47:21 +0000 (+0100) Subject: MINOR: filters: Add a function to remove a filter conf from all proxy lists X-Git-Tag: v3.5-dev10~36 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=b835990ad9b222456da71d3f33f6615f24710be4;p=haproxy.git MINOR: filters: Add a function to remove a filter conf from all proxy lists A legacy filter configuration is linked in three lists of its proxy: the global order with the 'list' member and the request and response orders with the 'by_req' and 'by_res' members. Removing such a configuration meant unlinking the three members by hand, in every filter supporting an implicit declaration replaced by an explicit one. The new flt_conf_delete() helper does it at once, as the counterpart of flt_conf_add() and flt_conf_insert(). It will be used by the filters parsing an explicit declaration that replaces an implicit one. --- diff --git a/include/haproxy/filters.h b/include/haproxy/filters.h index 8aaf1f206..9f4ffa118 100644 --- a/include/haproxy/filters.h +++ b/include/haproxy/filters.h @@ -229,6 +229,15 @@ static inline void flt_conf_insert(struct proxy *px, struct flt_conf *fconf) LIST_INSERT(&px->filters_res_configs, &fconf->by_res); } +/* Removes the legacy filter config from the three configuration + * lists.*/ +static inline void flt_conf_delete(struct flt_conf *fconf) +{ + LIST_DELETE(&fconf->list); + LIST_DELETE(&fconf->by_req); + LIST_DELETE(&fconf->by_res); +} + /* Helper function that returns the "global" state of filters attached to a * stream. */ static inline struct strm_flt *