]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: filters: Add a function to remove a filter conf from all proxy lists
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 27 Oct 2026 09:47:21 +0000 (10:47 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 27 Oct 2026 12:30:22 +0000 (13:30 +0100)
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.

include/haproxy/filters.h

index 8aaf1f20677a669de082de0a42620f204c40c2ef..9f4ffa1188f19f20f5fa6ae62a5868aa2b54f5ee 100644 (file)
@@ -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 <fconf> 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 *