]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: compression: move the default setting of maxzlibmem to defaults
authorWilly Tarreau <w@1wt.eu>
Mon, 25 Apr 2022 17:29:10 +0000 (19:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Apr 2022 17:42:43 +0000 (19:42 +0200)
commit197715ae2147eff0bfdb577612ce4a31d1aa65d3
tree65e006f94c7b2a9c7132ff7944a3a911be78a229
parentebab60279e45770d5c62e2f4988ddb745eaca35e
CLEANUP: compression: move the default setting of maxzlibmem to defaults

__comp_fetch_init() only presets the maxzlibmem, and only when both
USE_ZLIB and DEFAULT_MAXZLIBMEM are set. The intent is to preset a
default value to protect the system against excessive memory usage
when no setting is set by the user.

Nowadays the entry in the global struct is always there so there's no
point anymore in passing via a constructor to possibly set this value.
Let's go the cleaner way by always presetting DEFAULT_MAXZLIBMEM to 0
in defaults.h unless these conditions are met, and always assigning it
instead of pre-setting the entry to zero. This is more straightforward
and removes some ifdefs and the last constructor. In addition, now the
setting has a chance of being found.
include/haproxy/defaults.h
src/compression.c
src/haproxy.c