aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-07-24 20:37:15 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-07-24 20:37:15 +0100
commita15e3d27f41d18d917f93c25a1f475f09ad14e41 (patch)
tree0f08e4841d4b2af3ea9360c98ead838ee3dedea2 /src/lua
parentf9e5edbd6bb0bbbf8bad0e97eb02e2441d10e055 (diff)
downloadrspamd-a15e3d27f41d18d917f93c25a1f475f09ad14e41.tar.gz
rspamd-a15e3d27f41d18d917f93c25a1f475f09ad14e41.zip
[Minor] Restore Lua API
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_config.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index 06a22f096..0ab834054 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -2913,13 +2913,31 @@ lua_config_set_peak_cb (lua_State *L)
static gint
lua_config_enable_symbol (lua_State *L)
{
- return luaL_error (L, "obsoleted method");
+ struct rspamd_config *cfg = lua_check_config (L, 1);
+ const char *sym = luaL_checkstring (L, 2);
+
+ if (!sym || !cfg) {
+ return luaL_error (L, "invalid arguments");
+ }
+
+ rspamd_symcache_enable_symbol_static(cfg->cache, sym);
+
+ return 0;
}
static gint
lua_config_disable_symbol (lua_State *L)
{
- return luaL_error (L, "obsoleted method");
+ struct rspamd_config *cfg = lua_check_config (L, 1);
+ const char *sym = luaL_checkstring (L, 2);
+
+ if (!sym || !cfg) {
+ return luaL_error (L, "invalid arguments");
+ }
+
+ rspamd_symcache_disable_symbol_static(cfg->cache, sym);
+
+ return 0;
}
static gint