aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-05-27 19:16:13 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-05-27 19:16:13 +0400
commit7df6149f7f66c2d76a41f15fc7d6a6b988e8a696 (patch)
tree1941032fa577e871b265dcfeecee275d98a10f08 /src
parent0dc48ea239965d05b760cb9d8e570e0d91aedb77 (diff)
downloadrspamd-7df6149f7f66c2d76a41f15fc7d6a6b988e8a696.tar.gz
rspamd-7df6149f7f66c2d76a41f15fc7d6a6b988e8a696.zip
* In classify normalize result after comparing, not before
Diffstat (limited to 'src')
-rw-r--r--src/classifiers/winnow.c6
-rw-r--r--src/statfile.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/classifiers/winnow.c b/src/classifiers/winnow.c
index 1d48cc2ba..78e05d43b 100644
--- a/src/classifiers/winnow.c
+++ b/src/classifiers/winnow.c
@@ -232,9 +232,6 @@ winnow_classify (struct classifier_ctx *ctx, statfile_pool_t * pool, GTree * inp
if (data.count != 0) {
res = data.sum / data.count;
- if (st->normalizer != NULL) {
- res = st->normalizer (task->cfg, res, st->normalizer_data);
- }
}
else {
res = 0;
@@ -253,6 +250,9 @@ winnow_classify (struct classifier_ctx *ctx, statfile_pool_t * pool, GTree * inp
#ifdef WITH_LUA
max = call_classifier_post_callbacks (ctx->cfg, task, max);
#endif
+ if (st->normalizer != NULL) {
+ max = st->normalizer (task->cfg, max, st->normalizer_data);
+ }
insert_result (task, ctx->cfg->metric, sel->symbol, max, cur);
}
}
diff --git a/src/statfile.c b/src/statfile.c
index 1e47b3ec7..005ea7c8a 100644
--- a/src/statfile.c
+++ b/src/statfile.c
@@ -365,7 +365,7 @@ statfile_pool_open (statfile_pool_t * pool, char *filename, size_t size, gboolea
qsort (pool->files, pool->opened, sizeof (stat_file_t), cmpstatfile);
memory_pool_unlock_mutex (pool->lock);
- return new_file;
+ return statfile_pool_is_open (pool, filename);
}
int