From: Willy Tarreau Date: Mon, 26 Nov 2018 09:24:45 +0000 (+0100) Subject: BUILD: compression: fix build error with DEFAULT_MAXZLIBMEM X-Git-Tag: v1.9-dev9~145 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bfcd10218f96acfdbbf17a898df07703b73e06d;p=thirdparty%2Fhaproxy.git BUILD: compression: fix build error with DEFAULT_MAXZLIBMEM The tune.maxzlibmem setting was moved with commit 368780334 ("MEDIUM: compression: move the zlib-specific stuff from global.h to compression.c") but the preset value using DEFAULT_MAXZLIBMEM was incorrectly moved : - the field is in "global" and not "global.tune" - the trailing comma instead of semi-colon will make it either zero (threads enabled), break (threads enabled with debugging), or cast the memprintf's return pointer to int (threads disabled) It simply proves that nobody ever used DEFAULT_MAXZLIBMEM since 1.8! This needs to be backported to 1.8. --- diff --git a/src/compression.c b/src/compression.c index e7ce90a1f2..3c0cea5716 100644 --- a/src/compression.c +++ b/src/compression.c @@ -717,7 +717,7 @@ static void __comp_fetch_init(void) slz_prepare_dist_table(); #endif #if defined(USE_ZLIB) && defined(DEFAULT_MAXZLIBMEM) - global.tune.maxzlibmem = DEFAULT_MAXZLIBMEM * 1024U * 1024U, + global.maxzlibmem = DEFAULT_MAXZLIBMEM * 1024U * 1024U; #endif #ifdef USE_ZLIB HA_SPIN_INIT(&comp_pool_lock);