diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-07-14 11:17:34 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-07-14 11:17:34 +0400 |
commit | 6e877394d741fd99a2ed2246f802cd5655f061b5 (patch) | |
tree | 978bd6558110409feff55b20dec43b5e50494d1e /src | |
parent | 81d3a05c48d42073de4550341dd2efc36074105f (diff) | |
download | rspamd-6e877394d741fd99a2ed2246f802cd5655f061b5.tar.gz rspamd-6e877394d741fd99a2ed2246f802cd5655f061b5.zip |
Fix multiply compare_parts_distance calls.
Diffstat (limited to 'src')
-rw-r--r-- | src/expressions.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/expressions.c b/src/expressions.c index 2d564aa22..641cc6dc4 100644 --- a/src/expressions.c +++ b/src/expressions.c @@ -1044,8 +1044,18 @@ rspamd_parts_distance (struct worker_task * task, GList * args, void *unused) if ((pdiff = memory_pool_get_variable (task->task_pool, "parts_distance")) != NULL) { diff = *pdiff; - if (diff != -1 && diff <= threshold) { - return TRUE; + if (diff != -1) { + if (threshold2 > 0) { + if (diff >= MIN (threshold, threshold2) && diff <= MAX (threshold, threshold2)) { + return TRUE; + } + } + else { + if (diff <= threshold) { + return TRUE; + } + } + return FALSE; } else { return FALSE; |