commit 160c6ad: [Minor] Set current item when processing composites

Vsevolod Stakhov vsevolod at rspamd.com
Sun Aug 7 17:28:03 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-08-07 18:25:53 +0100
URL: https://github.com/rspamd/rspamd/commit/160c6ad5167ed20fbfd33b5ab413ca48cc4ed1f2 (HEAD -> master)

[Minor] Set current item when processing composites

---
 src/libserver/symcache/symcache_c.cxx | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/libserver/symcache/symcache_c.cxx b/src/libserver/symcache/symcache_c.cxx
index 76cac67b6..83d6b9842 100644
--- a/src/libserver/symcache/symcache_c.cxx
+++ b/src/libserver/symcache/symcache_c.cxx
@@ -657,10 +657,14 @@ rspamd_symcache_composites_foreach(struct rspamd_task *task,
 		auto *dyn_item = cache_runtime->get_dynamic_item(item->id);
 
 		if (!dyn_item->started) {
+			auto *old_item = cache_runtime->set_cur_item(dyn_item);
 			func((void *)item->get_name().c_str(), item->get_cbdata(), fd);
 			dyn_item->finished = true;
+			cache_runtime->set_cur_item(old_item);
 		}
 	});
+
+	cache_runtime->set_cur_item(nullptr);
 }
 
 gboolean


More information about the Commits mailing list