summaryrefslogtreecommitdiffstats
path: root/src/fuzzy_storage.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-03-23 18:40:50 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-03-23 18:40:50 +0300
commit7ee1ed10ba98a9dd8e727aa6a728ff29a3ca0ec4 (patch)
tree182fc17f6f741b53d60900ddd84b195bef38a322 /src/fuzzy_storage.c
parentf4dfc1a11a29280e7a3202165b8f41d775f06c08 (diff)
downloadrspamd-7ee1ed10ba98a9dd8e727aa6a728ff29a3ca0ec4.tar.gz
rspamd-7ee1ed10ba98a9dd8e727aa6a728ff29a3ca0ec4.zip
* Take block size into consideration while searching for fuzzy hash
Diffstat (limited to 'src/fuzzy_storage.c')
-rw-r--r--src/fuzzy_storage.c11
1 files 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 {