BUG/MINOR: http-fetch: Fix smp_fetch_body() when called from a health-check
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 25 Nov 2020 07:08:08 +0000 (08:08 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 27 Nov 2020 14:07:56 +0000 (15:07 +0100)
commit4b490b8af5704d3310727b13f87c5e8890ce18a4
tree88922451e848d21f1286e3bf72949bdb645eac20
parent2616784a08c83f65b0e451bba8dcba5a844e8dac
BUG/MINOR: http-fetch: Fix smp_fetch_body() when called from a health-check

res.body may be called from a health-check. It is probably never used. But it is
possibe. In such case, there is no channel. Thus we must not use it
unconditionally to set the flag SMP_F_MAY_CHANGE on the smp.

Now the condition test the channel first. In addtion, the flag is not set if the
payload is fully received.

This patch must be backported as far as 2.2.

(cherry picked from commit a9ffc416377e0df9859526dc3c1d769c6a68636f)
Signed-off-by: William Lallemand <wlallemand@haproxy.org>
src/http_fetch.c