diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-27 16:05:15 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-27 16:05:15 +0100 |
commit | 1ed9f282a568ef64372f687dba5ca25033b0ce2b (patch) | |
tree | af29263bf46da3c936cb1c9c0aa4743f9e736438 /src/libstat/stat_process.c | |
parent | 781af3209968da2b8d7a4b1e38d4a1473c8a9852 (diff) | |
download | rspamd-1ed9f282a568ef64372f687dba5ca25033b0ce2b.tar.gz rspamd-1ed9f282a568ef64372f687dba5ca25033b0ce2b.zip |
[Fix] Fix and rescore R_PARTS_DIFFER logic
Signed-off-by: Vsevolod Stakhov <vsevolod@highsecure.ru>
Diffstat (limited to 'src/libstat/stat_process.c')
-rw-r--r-- | src/libstat/stat_process.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c index e6d34e406..486d82c08 100644 --- a/src/libstat/stat_process.c +++ b/src/libstat/stat_process.c @@ -28,7 +28,7 @@ #define RSPAMD_LEARN_OP 1 #define RSPAMD_UNLEARN_OP 2 -static const gint similarity_treshold = 80; +static const gdouble similarity_treshold = 80.0; static void rspamd_stat_tokenize_header (struct rspamd_task *task, @@ -173,7 +173,7 @@ rspamd_stat_process_tokenize (struct rspamd_stat_ctx *st_ctx, GArray *words; gchar *sub; guint i, reserved_len = 0; - gint *pdiff; + gdouble *pdiff; for (i = 0; i < task->text_parts->len; i++) { part = g_ptr_array_index (task->text_parts, i); @@ -200,7 +200,7 @@ rspamd_stat_process_tokenize (struct rspamd_stat_ctx *st_ctx, } - if (pdiff != NULL && *pdiff > similarity_treshold) { + if (pdiff != NULL && (1.0 - *pdiff) * 100.0 > similarity_treshold) { msg_debug_task ("message has two common parts (%d%%), so skip the last one", *pdiff); break; |