From a21fb8ed5b1642031c2b612cac45d176e9fc00f8 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 14 Jul 2015 18:48:42 +0100 Subject: Start removing of old fuzzy algorithm. --- src/plugins/fuzzy_check.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 088a31979..ec849da54 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -978,18 +978,15 @@ fuzzy_generate_commands (struct rspamd_task *task, struct fuzzy_rule *rule, task->message_id, fuzzy_module_ctx->min_bytes); continue; } - /* Check length of hash */ - hashlen = strlen (part->fuzzy->hash_pipe); - if (hashlen == 0) { + if (part->words == NULL || part->words->len == 0) { msg_info ("<%s>, part hash empty, skip fuzzy check", task->message_id, fuzzy_module_ctx->min_hash_len); continue; } if (fuzzy_module_ctx->min_hash_len != 0 && - hashlen * part->fuzzy->block_size < - fuzzy_module_ctx->min_hash_len) { + part->words->len < fuzzy_module_ctx->min_hash_len) { msg_info ( "<%s>, part hash is shorter than %d symbols, skip fuzzy check", task->message_id, @@ -997,14 +994,6 @@ fuzzy_generate_commands (struct rspamd_task *task, struct fuzzy_rule *rule, continue; } - /* - * Try legacy first - */ - cmd = fuzzy_cmd_from_text_part (rule, c, flag, value, task->task_pool, - part, TRUE, NULL); - if (cmd) { - g_ptr_array_add (res, cmd); - } cmd = fuzzy_cmd_from_text_part (rule, c, flag, value, task->task_pool, part, FALSE, NULL); if (cmd) { -- cgit v1.2.3