From 7ee1ed10ba98a9dd8e727aa6a728ff29a3ca0ec4 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 23 Mar 2010 18:40:50 +0300 Subject: [PATCH] * Take block size into consideration while searching for fuzzy hash --- src/fuzzy_storage.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c index bd9096af9..3a7338b04 100644 --- a/src/fuzzy_storage.c +++ b/src/fuzzy_storage.c @@ -351,11 +351,14 @@ check_hash_node (GQueue *hash, fuzzy_hash_t *s, int update_value) pvalue = JudySLGet (jtree, s->hash_pipe, PJE0); if (pvalue != NULL) { h = *((struct rspamd_fuzzy_node **)pvalue); - msg_info ("fuzzy hash was found in judy tree"); - if (update_value) { - h->value += update_value; + /* Also check block size */ + if (h->h.block_size== s->block_size) { + msg_info ("fuzzy hash was found in judy tree"); + if (update_value) { + h->value += update_value; + } + return h->value; } - return h->value; } } else { -- 2.39.5