]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http-ana: Stop to wait for body on client error/abort
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 12 Feb 2026 10:24:27 +0000 (11:24 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 18 Feb 2026 08:44:16 +0000 (09:44 +0100)
During the message analysis, we must take care to stop wait for the message
body if an error was reported on client side or an abort was detected with
abort-on-close configured (by default now).

The bug was introduced when the "wait-for-body" action was added. Only the
producer state was tested. So, when we were waiting for the request payload,
there was no issue. But when we were waiting for the response payload, error
or abort on client side was not considered.

This patch should be backported to all stable versions.

src/http_ana.c

index 975c296d4c20273da31c2913943297c5215a5da7..0f52ba3f1dee1644d3fece924d6fb92193ad67d0 100644 (file)
@@ -4312,7 +4312,12 @@ enum rule_result http_wait_for_msg_body(struct stream *s, struct channel *chn,
        }
 
        /* we get here if we need to wait for more data */
-       if (!(chn_prod(chn)->flags & (SC_FL_EOS|SC_FL_ABRT_DONE))) {
+
+       if ((s->scf->flags & SC_FL_ERROR) ||
+           ((s->scf->flags & (SC_FL_EOS|SC_FL_ABRT_DONE)) &&
+            proxy_abrt_close_def(s->be, 1)))
+               ret = HTTP_RULE_RES_CONT;
+       else if (!(chn_prod(chn)->flags & (SC_FL_ERROR|SC_FL_EOS|SC_FL_ABRT_DONE))) {
                if (!tick_isset(chn->analyse_exp))
                        chn->analyse_exp = tick_add_ifset(now_ms, time);
                ret = HTTP_RULE_RES_YIELD;