]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: compression: fix build error with DEFAULT_MAXZLIBMEM
authorWilly Tarreau <w@1wt.eu>
Mon, 26 Nov 2018 09:24:45 +0000 (10:24 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 26 Nov 2018 09:27:51 +0000 (10:27 +0100)
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.

src/compression.c

index e7ce90a1f21416095fb1102240fd0ccf1b01f9af..3c0cea5716f94b7c849a2100a9c554fb9bff5e5f 100644 (file)
@@ -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);