]> source.dussan.org Git - rspamd.git/commitdiff
* Take block size into consideration while searching for fuzzy hash
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 23 Mar 2010 15:40:50 +0000 (18:40 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 23 Mar 2010 15:40:50 +0000 (18:40 +0300)
src/fuzzy_storage.c

index bd9096af988df3137d1f35f60d3dc9362b98245c..3a7338b04a7ea51decbb39236efbe8d3115598b2 100644 (file)
@@ -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 {