From: Willy Tarreau Date: Mon, 2 May 2016 13:25:15 +0000 (+0200) Subject: BUG/MEDIUM: http: fix incorrect reporting of server errors X-Git-Tag: v1.7-dev3~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f51d03cf14e68019ab776d4ab2365b15711d85f9;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: http: fix incorrect reporting of server errors Commit dbe34eb ("MEDIUM: filters/http: Move body parsing of HTTP messages in dedicated functions") introduced a bug in function http_response_forward_body() by getting rid of the while(1) loop. The code immediately following the loop was only reachable on missing data but now it's also reachable under normal conditions, which used to be dealt with by the skip_resync_state label returning zero. The side effect is that in http_server_close situations, the channel's SHUTR flag is seen and considered as a server error which is reported if any other error happens (eg: client timeout). This bug is specific to 1.7, no backport is needed. --- diff --git a/src/proto_http.c b/src/proto_http.c index 82d4b87006..a5334b590c 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -6709,6 +6709,7 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit } return 1; } + return 0; missing_data_or_waiting: if (res->flags & CF_SHUTW)