From fb7491db290eaee03e8e38266eb0d6fefb9d22ed Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 18 Jul 2017 19:49:41 +0100 Subject: [PATCH] [Minor] Add lua source code information to monitored --- src/lua/lua_config.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index cb65fad0a..916baa46e 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -2667,13 +2667,19 @@ lua_config_register_monitored (lua_State *L) if (cfg != NULL && url != NULL && type != NULL) { if (g_ascii_strcasecmp (type, "dns") == 0) { + lua_Debug ar; + if (lua_type (L, 4) == LUA_TTABLE) { params = ucl_object_lua_import (L, 4); } - m = rspamd_monitored_create (cfg->monitored_ctx, url, + /* Get lua line and source */ + lua_getstack (L, 1, &ar); + lua_getinfo (L, "nSl", &ar); + + m = rspamd_monitored_create_ (cfg->monitored_ctx, url, RSPAMD_MONITORED_DNS, RSPAMD_MONITORED_DEFAULT, - params); + params, ar.short_src); if (m) { pm = lua_newuserdata (L, sizeof (*pm)); -- 2.39.5