]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Add log tag to proxy scripts
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 15 Jun 2022 13:14:22 +0000 (14:14 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 15 Jun 2022 13:14:22 +0000 (14:14 +0100)
Issue: #4126

src/rspamd_proxy.c

index 2354576f74ac51e89a3ebd3ab552fb976b828c91..33906e31caea33816766aed25b3992a4588fcb1c 100644 (file)
@@ -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