diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-04-27 13:42:41 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-04-27 13:42:41 +0400 |
commit | df6562305f81d4d737a0aedf9f1560375daf8d39 (patch) | |
tree | 256c74fb1d34e64ec87fccb49d8b52367cd97e4b /src | |
parent | 17940ef125b638849d45ace31dca83e0780ed3bf (diff) | |
download | rspamd-df6562305f81d4d737a0aedf9f1560375daf8d39.tar.gz rspamd-df6562305f81d4d737a0aedf9f1560375daf8d39.zip |
* Skip identical parts while testing mime regexps
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/regexp.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index 6693d5782..e1f751ef9 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -203,7 +203,7 @@ static gsize process_regexp (struct rspamd_regexp *re, struct worker_task *task) { char *headerv, *c, t; - struct mime_text_part *part; + struct mime_text_part *part, *tmp; GList *cur, *headerlist; GRegex *regexp; struct uri *url; @@ -271,7 +271,16 @@ process_regexp (struct rspamd_regexp *re, struct worker_task *task) task_cache_add (task, re, 1); return 1; } - cur = g_list_next (cur); + /* Skip identical parts */ + while (cur) { + cur = g_list_next (cur); + if (cur) { + tmp = (struct mime_text_part *)cur->data; + if (fuzzy_compare_hashes (tmp->fuzzy, part->fuzzy) > 70) { + break; + } + } + } } task_cache_add (task, re, 0); return 0; |