From: Christopher Faulet Date: Fri, 15 Nov 2019 10:29:40 +0000 (+0100) Subject: BUG/MINOR: http-ana: Properly catch aborts during the payload forwarding X-Git-Tag: v2.1.0~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=145719a722def08c079589bf132160ac50911f9f;p=thirdparty%2Fhaproxy.git BUG/MINOR: http-ana: Properly catch aborts during the payload forwarding When no data filter are registered on a channel, if the message length is known, the HTTP payload is infinitely forwarded to save calls to process_stream(). When we finally fall back again in XFER_BODY analyzers, we detect the end of the message by checking channel flags. If CF_EOI or CF_SHUTR is set, we switch the message in DONE state. For CF_EOI, it is relevant. But not for CF_SHUTR. a shutdown for reads without the end of input must be interpreted as an abort for messages with a known length. Because of this bug, some aborts are not properly handled and reported. Instead, we interpret it as a legitimate shutdown. This patch must be backported to 2.0. --- diff --git a/src/http_ana.c b/src/http_ana.c index 428681d2c7..ee00d2c761 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -1166,7 +1166,7 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit) if (req->to_forward) { if (req->to_forward == CHN_INFINITE_FORWARD) { - if (req->flags & (CF_SHUTR|CF_EOI)) { + if (req->flags & CF_EOI) { msg->msg_state = HTTP_MSG_DONE; req->to_forward = 0; goto done; @@ -2179,7 +2179,7 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit if (res->to_forward) { if (res->to_forward == CHN_INFINITE_FORWARD) { - if (res->flags & (CF_SHUTR|CF_EOI)) { + if (res->flags & CF_EOI) { msg->msg_state = HTTP_MSG_DONE; res->to_forward = 0; goto done;