]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: compression: consider the expansion factor in init
authorWilly Tarreau <w@1wt.eu>
Sat, 28 Mar 2015 11:20:33 +0000 (12:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 28 Mar 2015 11:23:35 +0000 (12:23 +0100)
commit2aee2215c908c6997addcd1714b5b10f73c0703d
treec1eb4663b45d50f7430a369595097dc38ec7163a
parent15530d28a4ff58a370b27bde9672aaf7dbb7341f
BUG/MINOR: compression: consider the expansion factor in init

When checking if the buffer is large enough, we used to rely on a fixed
size that was "apparently" enough. We need to consider the expansion
factor of deflate-encoded streams instead, which is of 5 bytes per 32kB.
The previous value was OK till 128kB buffers but became wrong past that.
It's totally harmless since we always keep the reserve when compressiong,
so there's 1kB or so available, which is enough for buffers as large as
6.5 MB, but better fix the check anyway.

This fix could be backported into 1.5 since compression was added there.
src/compression.c