aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/scan_result.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-12-17 19:04:47 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-12-17 19:04:47 +0000
commitdafba2ac60f4bdc99b6f12a858f976133599d686 (patch)
treeab6455361f876f4b7d262cddef7e18fe954ca8ed /src/libmime/scan_result.c
parent4096a84ca4fb5731c2ef016accbdf7bc42cb46e1 (diff)
downloadrspamd-dafba2ac60f4bdc99b6f12a858f976133599d686.tar.gz
rspamd-dafba2ac60f4bdc99b6f12a858f976133599d686.zip
[Minor] Fix options insertion
Diffstat (limited to 'src/libmime/scan_result.c')
-rw-r--r--src/libmime/scan_result.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/src/libmime/scan_result.c b/src/libmime/scan_result.c
index 5ded3ac57..7a8451f9c 100644
--- a/src/libmime/scan_result.c
+++ b/src/libmime/scan_result.c
@@ -290,19 +290,9 @@ insert_metric_result (struct rspamd_task *task,
single = TRUE;
}
- /* Now check for the duplicate options */
- if (opt && s->options) {
- k = kh_get (rspamd_options_hash, s->options, opt);
+ s->nshots ++;
- if (k == kh_end (s->options)) {
- rspamd_task_add_result_option (task, s, opt);
- }
- else {
- s->nshots ++;
- }
- }
- else {
- s->nshots ++;
+ if (opt) {
rspamd_task_add_result_option (task, s, opt);
}
@@ -573,19 +563,8 @@ rspamd_task_add_result_option (struct rspamd_task *task,
}
}
else {
- opt = rspamd_mempool_alloc0 (task->task_pool, sizeof (*opt));
-
- if (opt_cpy == NULL) {
- opt_cpy = rspamd_mempool_strdup (task->task_pool, val);
- }
-
- k = kh_put (rspamd_options_hash, s->options, opt_cpy, &r);
-
- kh_value (s->options, k) = opt;
- opt->option = opt_cpy;
- DL_APPEND (s->opts_head, opt);
-
- ret = TRUE;
+ /* Skip addition */
+ ret = FALSE;
}
if (ret && s->opts_len >= 0) {