]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-lua: Warn if threading was detected
authorJosef 'Jeff' Sipek <jeff.sipek@open-xchange.com>
Thu, 10 Dec 2020 21:22:20 +0000 (16:22 -0500)
committerjeff.sipek <jeff.sipek@open-xchange.com>
Mon, 11 Jan 2021 16:36:23 +0000 (16:36 +0000)
src/lib-lua/dlua-script.c

index d5e85718095f20206cdfb737d66f92f906a5b2e4..d0899f0f50817cd0f2373a03968d51ce5d8a63be 100644 (file)
@@ -7,6 +7,7 @@
 #include "str.h"
 #include "hex-binary.h"
 #include "eacces-error.h"
+#include "ioloop.h"
 #include "dlua-script-private.h"
 
 #include <fcntl.h>
@@ -96,6 +97,15 @@ struct dlua_script *dlua_script_from_state(lua_State *L)
        lua_pop(L, 1);
        i_assert(script != NULL);
 
+       if (script->L != L) {
+               static bool warned;
+
+               if (!warned) {
+                       i_warning("detected threading in lua script - not supported");
+                       warned = TRUE; /* warn only once */
+               }
+       }
+
        return script;
 }