From: Frederic Lecaille Date: Thu, 2 Jul 2026 11:55:49 +0000 (+0200) Subject: BUG/MINOR: init: fix default global settings being overwritten by -G X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/%7B@url%7D?a=commitdiff_plain;h=e66c2c3acdceb4de501aea551ce3ed0f76b1c846;p=haproxy.git BUG/MINOR: init: fix default global settings being overwritten by -G The default global configuration tuning settings (tune.memory.hot-size, expose-experimental-directives, and tune.pipesize) were lost when the -G option was used. The bug was caused by an incorrect scope: these default settings were nested inside the block that generates the default global header, which is skipped/overwritten when -G is provided. Fix this by closing the conditional block early. This patch depends on this commit: "01f4e33ea MINOR: hbuf: new lightweight hbuf API" Must be backported to 3.4. --- diff --git a/src/haterm_init.c b/src/haterm_init.c index 0412a2f3c..c0a76494b 100644 --- a/src/haterm_init.c +++ b/src/haterm_init.c @@ -366,15 +366,17 @@ void haproxy_init_args(int argc, char **argv) ha_alert("failed to allocate a buffer.\n"); goto leave; } + hbuf_appendf(&gbuf, "global\n"); - hbuf_appendf(&gbuf, "\ttune.memory.hot-size 3145728\n"); - if (has_ssl) - hbuf_appendf(&gbuf, "\texpose-experimental-directives\n"); + } + + hbuf_appendf(&gbuf, "\ttune.memory.hot-size 3145728\n"); + if (has_ssl) + hbuf_appendf(&gbuf, "\texpose-experimental-directives\n"); #if defined(USE_LINUX_SPLICE) && defined(HA_USE_KTLS) - if (has_ssl) - hbuf_appendf(&gbuf, "\ttune.pipesize 262144\n"); + if (has_ssl) + hbuf_appendf(&gbuf, "\ttune.pipesize 262144\n"); #endif - } /* "global" section */ if (!hbuf_is_null(&gbuf))