/* The following Lua calls can fail. */
if (!SET_SAFE_LJMP(hlua_sub->hlua)) {
+ hlua_lock(hlua_sub->hlua);
if (lua_type(hlua_sub->hlua->T, -1) == LUA_TSTRING)
error = hlua_tostring_safe(hlua_sub->hlua->T, -1);
else
error = "critical error";
ha_alert("Lua event_hdl: %s.\n", error);
+ hlua_unlock(hlua_sub->hlua);
goto skip_event;
}
/* The following Lua calls can fail. */
if (!SET_SAFE_LJMP(stream->hlua)) {
+ hlua_lock(stream->hlua);
if (lua_type(stream->hlua->T, -1) == LUA_TSTRING)
error = hlua_tostring_safe(stream->hlua->T, -1);
else
error = "critical error";
SEND_ERR(stream->be, "Lua converter '%s': %s.\n", fcn->name, error);
+ hlua_unlock(stream->hlua);
return 0;
}
/* The following Lua calls can fail. */
if (!SET_SAFE_LJMP(stream->hlua)) {
+ hlua_lock(stream->hlua);
if (lua_type(stream->hlua->T, -1) == LUA_TSTRING)
error = hlua_tostring_safe(stream->hlua->T, -1);
else
error = "critical error";
SEND_ERR(smp->px, "Lua sample-fetch '%s': %s.\n", fcn->name, error);
+ hlua_unlock(stream->hlua);
return 0;
}
/* The following Lua calls can fail. */
if (!SET_SAFE_LJMP(s->hlua)) {
+ hlua_lock(s->hlua);
if (lua_type(s->hlua->T, -1) == LUA_TSTRING)
error = hlua_tostring_safe(s->hlua->T, -1);
else
error = "critical error";
SEND_ERR(px, "Lua function '%s': %s.\n",
rule->arg.hlua_rule->fcn->name, error);
+ hlua_unlock(s->hlua);
goto end;
}
/* The following Lua calls can fail. */
if (!SET_SAFE_LJMP(hlua)) {
+ hlua_lock(hlua);
if (lua_type(hlua->T, -1) == LUA_TSTRING)
error = hlua_tostring_safe(hlua->T, -1);
else
error = "critical error";
SEND_ERR(strm->be, "Lua applet tcp '%s': %s.\n",
ctx->rule->arg.hlua_rule->fcn->name, error);
+ hlua_unlock(hlua);
return -1;
}
/* The following Lua calls can fail. */
if (!SET_SAFE_LJMP(hlua)) {
+ hlua_lock(hlua);
if (lua_type(hlua->T, -1) == LUA_TSTRING)
error = hlua_tostring_safe(hlua->T, -1);
else
error = "critical error";
SEND_ERR(strm->be, "Lua applet http '%s': %s.\n",
ctx->rule->arg.hlua_rule->fcn->name, error);
+ hlua_unlock(hlua);
return -1;
}
/* The following Lua calls can fail. */
if (!SET_SAFE_LJMP(hlua)) {
+ hlua_lock(hlua);
if (lua_type(hlua->T, -1) == LUA_TSTRING)
error = hlua_tostring_safe(hlua->T, -1);
else
error = "critical error";
SEND_ERR(NULL, "Lua cli '%s': %s.\n", fcn->name, error);
+ hlua_unlock(hlua);
goto error;
}
if (!SET_SAFE_LJMP(s->hlua)) {
const char *error;
+ hlua_lock(s->hlua);
if (lua_type(s->hlua->T, -1) == LUA_TSTRING)
error = hlua_tostring_safe(s->hlua->T, -1);
else
error = "critical error";
SEND_ERR(s->be, "Lua filter '%s': %s.\n", conf->reg->name, error);
+ hlua_unlock(s->hlua);
ret = 0;
goto end;
}
if (!SET_SAFE_LJMP(flt_hlua)) {
const char *error;
+ hlua_lock(flt_hlua);
if (lua_type(flt_hlua->T, -1) == LUA_TSTRING)
error = hlua_tostring_safe(flt_hlua->T, -1);
else
error = "critical error";
SEND_ERR(s->be, "Lua filter '%s': %s.\n", conf->reg->name, error);
+ hlua_unlock(flt_hlua);
goto end;
}