]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Add some more methods
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 20 Apr 2022 18:17:31 +0000 (19:17 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 20 Apr 2022 18:17:31 +0000 (19:17 +0100)
src/libserver/symcache/symcache_c.cxx
src/libserver/symcache/symcache_item.hxx

index 5d1711ed9f210638013c2498f189ebab024b5548..29aa1d91d5ad8ade7bce340fc36848104667c39a 100644 (file)
@@ -175,4 +175,11 @@ rspamd_symcache_start_refresh (struct rspamd_symcache *cache,
 {
        auto *real_cache = C_API_SYMCACHE(cache);
        return new rspamd::symcache::cache_refresh_cbdata{real_cache, ev_base, w};
+}
+
+void
+rspamd_symcache_inc_frequency(struct rspamd_symcache *_cache, struct rspamd_symcache_item *item)
+{
+       auto *real_item = C_API_SYMCACHE_ITEM(item);
+       real_item->inc_frequency();
 }
\ No newline at end of file
index d68178043ef0cf1652dbeadb65f56ecddc27e7d1..c5b6c8ff70d03f5bb31643dade4437b811a508cd 100644 (file)
@@ -282,6 +282,10 @@ public:
                                                                        double cur_time,
                                                                        double last_resort) -> bool;
 
+       auto inc_frequency() -> void {
+               g_atomic_int_inc(&st->hits);
+       }
+
 private:
        /**
         * Constructor for a normal symbols with callback