]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stream: Don't use small buffer on queuing with a request data filter
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 3 Jun 2026 12:28:27 +0000 (14:28 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 3 Jun 2026 12:29:51 +0000 (14:29 +0200)
When there is a filter registered on the request data forwarding, we must
disable usage of the small buffers. For now it is safer to do so because we
don't know if the filter will properly handle the small buffers. In
addition, there is a true issue because it is possible to never re-arm the
receives in that case because the buffer reserve must be respected. This
leads to think a small buffer is always full, even empty one.

No backport needed.

src/stream.c

index 73feb7ebfd2ddc49f73445bc6abf1457083e647c..10543f86229bda44070e0847faddb4e24c9ba6d1 100644 (file)
@@ -2517,7 +2517,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
                        if (scb->state == SC_ST_ASS && srv && srv->rdr_len && (s->flags & SF_REDIRECTABLE))
                                http_perform_server_redirect(s, scb);
 
-                       if (unlikely((s->be->options2 & PR_O2_USE_SBUF_QUEUE) && scb->state == SC_ST_QUE)) {
+                       if (unlikely((s->be->options2 & PR_O2_USE_SBUF_QUEUE) && scb->state == SC_ST_QUE && !HAS_REQ_DATA_FILTERS(s))) {
                                struct buffer sbuf = BUF_NULL;
 
                                if (IS_HTX_STRM(s)) {