From: Vsevolod Stakhov Date: Wed, 15 Jun 2022 13:14:22 +0000 (+0100) Subject: [Minor] Add log tag to proxy scripts X-Git-Tag: 3.3~193 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c115d958c16dcc51cc8c6668e0f9df18e6eed02;p=thirdparty%2Frspamd.git [Minor] Add log tag to proxy scripts Issue: #4126 --- diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c index 2354576f74..33906e31ca 100644 --- a/src/rspamd_proxy.c +++ b/src/rspamd_proxy.c @@ -1011,13 +1011,17 @@ proxy_call_cmp_script (struct rspamd_proxy_session *session, gint cbref) } } - if (lua_pcall (L, 1, 0, err_idx) != 0) { + gchar log_tag[RSPAMD_LOG_ID_LEN + 1]; + rspamd_strlcpy(log_tag, session->pool->tag.uid, sizeof (session->pool->tag.uid)); + lua_pushstring(L, log_tag); + + if (lua_pcall (L, 2, 0, err_idx) != 0) { msg_err_session ( "cannot run lua compare script: %s", lua_tostring (L, -1)); } - lua_settop (L, 0); + lua_settop (L, err_idx - 1); } static void