]> git.kaiwu.me - haproxy.git/commit
MINOR: httpclient: Don't use co_set_data() to decrement output
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 29 Apr 2022 12:09:03 +0000 (14:09 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 29 Apr 2022 12:12:42 +0000 (14:12 +0200)
commit0055d5693e8ba1c21bae7a231506945cdf8b81d9
tree2a394237b8033b12efa82b92b521239bd929b3ff
parent6b4f1f64a8641a02be8565c324cb355ef578162c
MINOR: httpclient: Don't use co_set_data() to decrement output

The use of co_set_data() should be strictly limited to setting the amount of
existing data to be transmitted. It ought not be used to decrement the
output after the data have left the buffer, because doing so involves
performing incorrect calculations using co_data() that still comprises data
that are not in the buffer anymore. Let's use c_rew() for this, which is
made exactly for this purpose, i.e. decrement c->output by as much as
requested.
src/http_client.c