]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: httpclient: CF_SHUTW_NOW should be tested with channel_is_empty()
authorWilliam Lallemand <wlallemand@haproxy.org>
Thu, 17 Mar 2022 14:14:15 +0000 (15:14 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 18 Mar 2022 10:34:10 +0000 (11:34 +0100)
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.

src/http_client.c

index 39d7aa2ace568a48268553d294df8dda34d3f837..fec35c1b6591e2886d85c99863a96a7977956642 100644 (file)
@@ -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;