]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: filters: Use filter API as far as poissible to break loops on filters
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 4 Mar 2026 08:05:14 +0000 (09:05 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 5 Mar 2026 14:34:47 +0000 (15:34 +0100)
When the filters API was refactored to improve loops on filters, some places
were not updated (or not fully updated). Some loops were not relying on
resume_filter_list_break() while it was possible. So let's do so with this
patch.

src/filters.c

index f12f16e2e2821e76fc5071d52d80e54c452828f7..2add2ab79be4ba564f3510d77e9c840a3be1469b 100644 (file)
@@ -741,8 +741,7 @@ flt_http_payload(struct stream *s, struct http_msg *msg, unsigned int len)
                filter->calls++;
                ret = FLT_OPS(filter)->http_payload(s, filter, msg, out + offset, data - offset);
                if (ret < 0) {
-                       s->last_entity.type = STRM_ENTITY_FILTER;
-                       s->last_entity.ptr = filter;
+                       resume_filter_list_break(s, msg->chn, filter, ret);
                        goto end;
                }
                data = ret + *flt_off - *strm_off;
@@ -888,8 +887,7 @@ flt_post_analyze(struct stream *s, struct channel *chn, unsigned int an_bit)
                        filter->calls++;
                        ret = FLT_OPS(filter)->channel_post_analyze(s, filter, chn, an_bit);
                        if (ret < 0) {
-                               s->last_entity.type = STRM_ENTITY_FILTER;
-                               s->last_entity.ptr = filter;
+                               resume_filter_list_break(s, chn, filter, ret);
                                break;
                        }
                        filter->post_analyzers &= ~an_bit;
@@ -1053,8 +1051,7 @@ flt_tcp_payload(struct stream *s, struct channel *chn, unsigned int len)
                filter->calls++;
                ret = FLT_OPS(filter)->tcp_payload(s, filter, chn, out + offset, data - offset);
                if (ret < 0) {
-                       s->last_entity.type = STRM_ENTITY_FILTER;
-                       s->last_entity.ptr = filter;
+                       resume_filter_list_break(s, chn, filter, ret);
                        goto end;
                }
                data = ret + *flt_off - *strm_off;