]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Set current item when processing composites
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 7 Aug 2022 17:25:53 +0000 (18:25 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 7 Aug 2022 17:25:53 +0000 (18:25 +0100)
src/libserver/symcache/symcache_c.cxx

index 76cac67b60116d8892644e80b6862afacead51ac..83d6b98422e38539f137885a9d089bf4d81449f3 100644 (file)
@@ -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