]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: pools: add a new flag to avoid rounding pool size up
authorWilly Tarreau <w@1wt.eu>
Mon, 25 Jan 2016 01:19:13 +0000 (02:19 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Jan 2016 01:31:18 +0000 (02:31 +0100)
commit581bf81d34ee312fce1fe4d28b6d1f03995b350c
tree21d2250eee703aa51e6fc90511affa0db6d96cc9
parent999f643ed2dcf72779e8c18f300171d87177c04b
MEDIUM: pools: add a new flag to avoid rounding pool size up

Usually it's desirable to merge similarly sized pools, which is the
reason why their size is rounded up to the next multiple of 16. But
for the buffers this is problematic because we add the size of
struct buffer to the user-requested size, and the rounding results
in 8 extra bytes that are usable in the end. So the user gets more
bytes than asked for, and in case of SSL it results in short writes
for the extra bytes that are sent above multiples of 16 kB.

So we add a new flag MEM_F_EXACT to request that the size is not
rounded up when creating the entry. Thus it doesn't disable merging.
include/common/memory.h
src/memory.c