From: William Lallemand Date: Thu, 17 Mar 2022 14:14:15 +0000 (+0100) Subject: BUG/MINOR: httpclient: CF_SHUTW_NOW should be tested with channel_is_empty() X-Git-Tag: v2.6-dev4~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=58a81aeb91bc0c3b07f340852c09af3b5692899a;p=thirdparty%2Fhaproxy.git BUG/MINOR: httpclient: CF_SHUTW_NOW should be tested with channel_is_empty() CF_SHUTW_NOW shouldn't be a condition alone to exit the io handler, it must be tested with the emptiness of the response channel. Must be backported to 2.5. --- diff --git a/src/http_client.c b/src/http_client.c index 39d7aa2ace..fec35c1b65 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -928,7 +928,8 @@ more: * isn't any data to handle and a shutdown is detected, let's stop * everything */ if ((req->flags & (CF_SHUTR|CF_SHUTR_NOW)) || - (res->flags & (CF_SHUTW|CF_SHUTW_NOW))) { + (res->flags & CF_SHUTW) || + ((res->flags & CF_SHUTW_NOW) && channel_is_empty(res))) { goto end; } return;