]> git.kaiwu.me - haproxy.git/commit
BUN/MINOR: hlua: reset hlua_body variable after per-thread files loading
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 1 Sep 2026 14:51:54 +0000 (16:51 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 1 Sep 2026 15:56:07 +0000 (17:56 +0200)
commit10581b95e8a07dd95a98e3cd9d116213a4d63f52
tree6ead7ccab110aca070a566173ad4de96ac41cc86
parent29c70e199f69122f4eba49ece50c06ccaac1b7b5
BUN/MINOR: hlua: reset hlua_body variable after per-thread files loading

hlua_body variable was introduced to know if the files loading was passed or
not and emit warnings if some operations are performed during runtime. In
particular, it was used to detect calls to core.use_native_mailers_config()
during runtime.

However, the hlua_body variable was reset too early in the post-init
function, before the per-thread files loading. Because of this issue,
loading mailers.lua script using 'lua-load-per-thread' directive led to the
following error during haproxy startup:

  ... use_native_mailers_config: not available outside of body context

To fix the issue, this variable is now reset at the end of the function.

This patch must be backported as far as 3.3. It should fix the issue #3487.
src/hlua.c