]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: compression/htx: Fix the adding of the last data block
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 11 Jun 2019 08:38:38 +0000 (10:38 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 11 Jun 2019 12:05:25 +0000 (14:05 +0200)
commit86bc8df95579c69c0468722ac8b15acd2cb596fd
treeef69f64ecc3e4e0c41054bf998cbbe1229ab0592
parentbda8397fba027eaee2c46d566a7e85343dc2de02
BUG/MEDIUM: compression/htx: Fix the adding of the last data block

The function htx_add_data_before() is buggy and cannot work. It first add a data
block and then move it before another one, passed in argument. The problem
happens when a defragmentation is done to add the new block. In this case, the
reference is no longer valid, because the blocks are rearranged. So, instead of
moving the new block before the reference, it is moved at the head of the HTX
message.

So this function has been removed. It was only used by the compression filter to
add a last data block before a TLR, EOT or EOM block. Now, the new function
htx_add_last_data() is used. It adds a last data block, after all others and
before any TLR, EOT or EOM block. Then, the next bock is get. It is the first
non-data block after data in the HTX message. The compression loop continues
with it.

This patch must be backported to 1.9.
include/common/htx.h
src/flt_http_comp.c
src/htx.c