BUG/MINOR: http-ana: Stop to wait for body on client error/abort

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.
This commit is contained in:
Christopher Faulet 2026-02-12 11:24:27 +01:00
parent b983bca881
commit 650f29c78d

View 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;