mirror of
https://github.com/haproxy/haproxy.git
synced 2026-07-07 00:03:09 -04:00
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.
This commit is contained in:
parent
146015e58b
commit
e66c2c3acd
1 changed files with 9 additions and 7 deletions
|
|
@ -366,16 +366,18 @@ 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");
|
||||
#if defined(USE_LINUX_SPLICE) && defined(HA_USE_KTLS)
|
||||
if (has_ssl)
|
||||
hbuf_appendf(&gbuf, "\ttune.pipesize 262144\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
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");
|
||||
#endif
|
||||
|
||||
/* "global" section */
|
||||
if (!hbuf_is_null(&gbuf))
|
||||
hbuf_appendf(&mbuf, "%.*s\n", (int)gbuf.data, gbuf.area);
|
||||
|
|
|
|||
Loading…
Reference in a new issue