diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-04-07 18:42:03 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-04-08 18:42:05 +0100 |
commit | ae103665a2ce2321f109a21a7534db6629a6132b (patch) | |
tree | 22347f2fa011195b5ca433c7116cf1914bf01bf0 /src/libmime/scan_result.c | |
parent | 748f80fdfe4076488442aecf418fa8ac30bce72e (diff) | |
download | rspamd-ae103665a2ce2321f109a21a7534db6629a6132b.tar.gz rspamd-ae103665a2ce2321f109a21a7534db6629a6132b.zip |
[Project] Rework grow factor as it is currently broken
Diffstat (limited to 'src/libmime/scan_result.c')
-rw-r--r-- | src/libmime/scan_result.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/src/libmime/scan_result.c b/src/libmime/scan_result.c index b9660071b..54d6d5841 100644 --- a/src/libmime/scan_result.c +++ b/src/libmime/scan_result.c @@ -231,7 +231,7 @@ insert_metric_result(struct rspamd_task *task, bool *new_sym) { struct rspamd_symbol_result *symbol_result = NULL; - double final_score, *gr_score = NULL, next_gf = 1.0, diff; + double final_score, *gr_score = NULL, diff; struct rspamd_symbol *sdef; struct rspamd_symbols_group *gr = NULL; const ucl_object_t *mobj, *sobj; @@ -368,17 +368,6 @@ insert_metric_result(struct rspamd_task *task, } if (diff) { - /* Handle grow factor */ - if (metric_res->grow_factor && diff > 0) { - diff *= metric_res->grow_factor; - next_gf *= task->cfg->grow_factor; - } - else if (diff > 0) { - next_gf = task->cfg->grow_factor; - } - - msg_debug_metric("adjust grow factor to %.2f for symbol %s (%.2f final)", - next_gf, symbol, diff); if (sdef) { PTR_ARRAY_FOREACH(sdef->groups, i, gr) @@ -418,8 +407,6 @@ insert_metric_result(struct rspamd_task *task, } if (!isnan(diff)) { - metric_res->score += diff; - metric_res->grow_factor = next_gf; if (single) { msg_debug_metric("final score for single symbol %s = %.2f; %.2f diff", @@ -447,18 +434,6 @@ insert_metric_result(struct rspamd_task *task, symbol_result = rspamd_mempool_alloc0(task->task_pool, sizeof(*symbol_result)); kh_value(metric_res->symbols, k) = symbol_result; - /* Handle grow factor */ - if (metric_res->grow_factor && final_score > 0) { - final_score *= metric_res->grow_factor; - next_gf *= task->cfg->grow_factor; - } - else if (final_score > 0) { - next_gf = task->cfg->grow_factor; - } - - msg_debug_metric("adjust grow factor to %.2f for symbol %s (%.2f final)", - next_gf, symbol, final_score); - symbol_result->name = sym_cpy; symbol_result->sym = sdef; symbol_result->nshots = 1; @@ -503,7 +478,6 @@ insert_metric_result(struct rspamd_task *task, const double epsilon = DBL_EPSILON; metric_res->score += final_score; - metric_res->grow_factor = next_gf; symbol_result->score = final_score; if (final_score > epsilon) { |