aboutsummaryrefslogtreecommitdiffstats
path: root/src/cfg_utils.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-12-04 13:41:26 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-12-04 13:41:26 +0000
commit703fb40d6e37c5337a23694bce1bb114b7d7516a (patch)
treeebdba3aaa9018a01c21702c0785f00c609e77e21 /src/cfg_utils.c
parentd0314f0ca99d2485054b692de565729f4e961306 (diff)
downloadrspamd-703fb40d6e37c5337a23694bce1bb114b7d7516a.tar.gz
rspamd-703fb40d6e37c5337a23694bce1bb114b7d7516a.zip
Rework fuzzy check module.
- Now all checks are organized to rules. - Allow to specify read_only rules to avoid problems on learning. - Use better normalizer for fuzzy module and it now returns values from 0 to 1.0 (like bayes does). - Update configuration accordingly. - Drop legacy configuration support. - Detect tanh as well and provide some reasonable (linear) fallback.
Diffstat (limited to 'src/cfg_utils.c')
-rw-r--r--src/cfg_utils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cfg_utils.c b/src/cfg_utils.c
index 765ff7f34..d015d60a0 100644
--- a/src/cfg_utils.c
+++ b/src/cfg_utils.c
@@ -635,12 +635,14 @@ internal_normalizer_func (struct config_file *cfg, long double score, void *data
}
#ifdef HAVE_TANHL
return max * tanhl (score / max);
-#else
+#elif defined(HAVE_TANHL)
/*
* As some implementations of libm does not support tanhl, try to use
* tanh
*/
return max * tanh ((double) (score / max));
+#else
+ return score < max ? score / max : max;
#endif
}