commit 8c115d9: [Minor] Add log tag to proxy scripts

Vsevolod Stakhov vsevolod at rspamd.com
Wed Jun 15 13:21:03 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-06-15 14:14:22 +0100
URL: https://github.com/rspamd/rspamd/commit/8c115d958c16dcc51cc8c6668e0f9df18e6eed02 (HEAD -> master)

[Minor] Add log tag to proxy scripts
Issue: #4126

---
 src/rspamd_proxy.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c
index 2354576f7..33906e31c 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


More information about the Commits mailing list