diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-12-09 13:58:51 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-12-09 13:58:51 +0000 |
commit | 414287af7eccf490d43f6ddafddb020152b6f56f (patch) | |
tree | 16476a7f5728dfd790eb0db16c5903870164fb90 /src | |
parent | aef0c78138f490e5a494ee7673bdba95bcf08f56 (diff) | |
download | rspamd-414287af7eccf490d43f6ddafddb020152b6f56f.tar.gz rspamd-414287af7eccf490d43f6ddafddb020152b6f56f.zip |
Fix fuzzy_add for messages without valid parts.
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/fuzzy_check.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 48414a82b..ba07acd2f 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -912,6 +912,7 @@ fuzzy_process_rule (struct controller_session *session, struct fuzzy_rule *rule, GList *cur; gchar *checksum; fuzzy_hash_t fake_fuzzy; + gboolean processed = FALSE; /* Plan new event for writing */ cur = task->text_parts; @@ -933,6 +934,7 @@ fuzzy_process_rule (struct controller_session *session, struct fuzzy_rule *rule, /* Cannot write hash */ return FALSE; } + processed = TRUE; cur = g_list_next (cur); } @@ -956,6 +958,7 @@ fuzzy_process_rule (struct controller_session *session, struct fuzzy_rule *rule, msg_info ("save hash of image: [%s] to list: %d", checksum, flag); g_free (checksum); + processed = TRUE; } } } @@ -981,6 +984,7 @@ fuzzy_process_rule (struct controller_session *session, struct fuzzy_rule *rule, mime_part->type->type, mime_part->type->subtype, checksum, flag); g_free (checksum); + processed = TRUE; } } cur = g_list_next (cur); @@ -988,7 +992,7 @@ fuzzy_process_rule (struct controller_session *session, struct fuzzy_rule *rule, memory_pool_add_destructor (session->session_pool, (pool_destruct_func)free_task_soft, task); - return TRUE; + return processed; } static gboolean @@ -1055,10 +1059,12 @@ fuzzy_process_handler (struct controller_session *session, f_str_t * in) continue; } - processed = TRUE; - res = fuzzy_process_rule (session, rule, task, err, cmd, flag, value, saved); + if (res) { + processed = TRUE; + } + cur = g_list_next (cur); } |