]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: httpclient: Fix loop consuming HTX blocks from the response channel
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 29 Apr 2022 11:44:46 +0000 (13:44 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 29 Apr 2022 12:12:42 +0000 (14:12 +0200)
commit534645d6c0e853dec5919764c693052f729e07ed
treeaad505bf05db3a99f0b5cc233b0411524b3c71d5
parenta6c4a48341ce21f57f1b226fa0a047df3472c07e
BUG/MEDIUM: httpclient: Fix loop consuming HTX blocks from the response channel

When the HTTP client consumes the response, it loops on the HTX message to
copy blocks content and it removes blocks by calling htx_remove_blk(). But
this function removes a block and returns the next one in the HTX
message. The result must be used instead of using htx_get_next(). It is
especially important because the block used in htx_get_next() loop was
removed. It only works because the message is not defragmented during the
loop.

In addition, the loop on the response was simplified to iter on blocks
instead of positions.

This patch must be backported to 2.5.
src/http_client.c