aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/symbols_cache.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-09-16 13:52:43 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-09-16 13:52:43 +0100
commit6546a6b24497b6f85706ee6f4bf5dd4ed36a18f8 (patch)
tree6d8b9f5a6770b4f46b8997fc90ac3503ebbfcef4 /src/libserver/symbols_cache.c
parenta0ac165d0376cd9396a87fbf593843bddb5b412c (diff)
downloadrspamd-6546a6b24497b6f85706ee6f4bf5dd4ed36a18f8.tar.gz
rspamd-6546a6b24497b6f85706ee6f4bf5dd4ed36a18f8.zip
[Fix] Do not include idempotent/nostat symbols to checksum
Diffstat (limited to 'src/libserver/symbols_cache.c')
-rw-r--r--src/libserver/symbols_cache.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c
index 3a8c4ee32..c76c17e4e 100644
--- a/src/libserver/symbols_cache.c
+++ b/src/libserver/symbols_cache.c
@@ -769,18 +769,24 @@ rspamd_symbols_cache_add_symbol (struct symbols_cache *cache,
item->parent = parent;
cache->used_items ++;
+ if (!(item->type &
+ (SYMBOL_TYPE_IDEMPOTENT|SYMBOL_TYPE_NOSTAT|SYMBOL_TYPE_CLASSIFIER))) {
+ if (name != NULL) {
+ cache->cksum = t1ha (name, strlen (name),
+ cache->cksum);
+ } else {
+ cache->cksum = t1ha (&item->id, sizeof (item->id),
+ cache->cksum);
+ }
+ }
+
if (name != NULL) {
item->symbol = rspamd_mempool_strdup (cache->static_pool, name);
msg_debug_cache ("used items: %d, added symbol: %s, %d",
cache->used_items, name, item->id);
- cache->cksum = t1ha (item->symbol, strlen (item->symbol),
- cache->cksum);
- }
- else {
+ } else {
msg_debug_cache ("used items: %d, added unnamed symbol: %d",
cache->used_items, item->id);
- cache->cksum = t1ha (&item->id, sizeof (item->id),
- cache->cksum);
}
g_ptr_array_add (cache->items_by_id, item);