From: Vsevolod Stakhov Date: Tue, 23 Mar 2010 15:40:50 +0000 (+0300) Subject: * Take block size into consideration while searching for fuzzy hash X-Git-Tag: 0.3.0~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ee1ed10ba98a9dd8e727aa6a728ff29a3ca0ec4;p=thirdparty%2Frspamd.git * Take block size into consideration while searching for fuzzy hash --- diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c index bd9096af98..3a7338b04a 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 {