]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: channel: don't use co_set_data() to decrement output
authorWilly Tarreau <w@1wt.eu>
Mon, 28 Feb 2022 15:51:23 +0000 (16:51 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 28 Feb 2022 15:51:23 +0000 (16:51 +0100)
commit84240044f0ecebac489f5b689142a9dfe27ea99d
tree084f889c5e6a21c1c5163c585bb89e4397645766
parent8873b85bd92fb4a7744f13bf462c540ed6c4946d
MINOR: channel: 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. This is cleaner, faster, and will permit stricter checks.
include/haproxy/channel.h
src/hlua.c
src/stream_interface.c