From: Vsevolod Stakhov Date: Tue, 18 Jul 2017 18:49:41 +0000 (+0100) Subject: [Minor] Add lua source code information to monitored X-Git-Tag: 1.7.0~836 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fb7491db290eaee03e8e38266eb0d6fefb9d22ed;p=rspamd.git [Minor] Add lua source code information to monitored --- 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));