commit e3748d4: [Minor] Allow rspamd_text to be passed

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Jul 24 19:35:10 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-07-24 15:15:10 +0100
URL: https://github.com/rspamd/rspamd/commit/e3748d403bf05f87ddc12d38869321557b99ad45

[Minor] Allow rspamd_text to be passed

---
 src/lua/lua_common.c | 2 ++
 src/lua/lua_common.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c
index d53ebbc48..c658181ee 100644
--- a/src/lua/lua_common.c
+++ b/src/lua/lua_common.c
@@ -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;
diff --git a/src/lua/lua_common.h b/src/lua/lua_common.h
index 76680cbc5..cc4c9a9d4 100644
--- a/src/lua/lua_common.h
+++ b/src/lua/lua_common.h
@@ -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


More information about the Commits mailing list