]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Allow rspamd_text to be passed
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 24 Jul 2020 14:15:10 +0000 (15:15 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 24 Jul 2020 19:33:33 +0000 (20:33 +0100)
src/lua/lua_common.c
src/lua/lua_common.h

index d53ebbc48c1695231ec5d8d2738b554d5cd354bc..c658181ee19a7969f065c4606f5b28a2e6937d0a 100644 (file)
@@ -2479,6 +2479,7 @@ rspamd_lua_universal_pcall (lua_State *L, gint cbref, const gchar* strloc,
         * - u - lua_userdata, argument - (const char * + void *) - classname + pointer
         * - b - lua_boolean, argument - gboolean (not bool due to varargs promotion)
         * - f - lua_function, argument - int - position of the function on stack (not lua_registry)
+        * - t - lua_text, argument - int - position of the lua_text on stack (not lua_registry)
         */
        while (*argp) {
                switch (*argp) {
@@ -2511,6 +2512,7 @@ rspamd_lua_universal_pcall (lua_State *L, gint cbref, const gchar* strloc,
                        nargs ++;
                        break;
                case 'f':
+               case 't':
                        lua_pushvalue (L, va_arg (ap, gint));
                        nargs ++;
                        break;
index 76680cbc5945636e029c84152ac864cbf3df6e8e..cc4c9a9d4dcfa0d0f0f20a11a2b82c1287ce92a2 100644 (file)
@@ -594,6 +594,7 @@ gchar *rspamd_lua_get_module_name (lua_State *L);
  * - u - lua_userdata, argument - (const char * + void *) - classname + pointer
  * - b - lua_boolean, argument - gboolean (not bool due to varargs promotion)
  * - f - lua_function, argument - int - position of the function on stack (not lua_registry)
+ * - t - lua_text, argument - int - position of the lua_text on stack (not lua_registry)
  * @param L lua state
  * @param cbref LUA_REGISTRY reference
  * @param strloc where this function is called from