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.
struct hlua_function *fcn;
struct hlua_reg_filter *reg_flt;
- hlua_body = 0;
-
-
#if defined(USE_OPENSSL)
/* Initialize SSL server. */
if (socket_ssl->xprt->prepare_srv) {
if (errors > 0)
return 0;
+ hlua_body = 0;
+
/* after this point, this global will no longer be used, so set to
* -1 in order to have probably a segfault if someone use it
*/