summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-08-04 17:50:57 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-08-04 17:50:57 +0400
commit80b5b55a53622875d4973ea1d440dc7fa916f20b (patch)
tree5ad851c6fe7e6fd31fa246d874b53ae75f970012
parentf46e13b47c010f16075350e17ca0dbfea46e6e05 (diff)
downloadrspamd-80b5b55a53622875d4973ea1d440dc7fa916f20b.tar.gz
rspamd-80b5b55a53622875d4973ea1d440dc7fa916f20b.zip
* Fix wirting message id during fuzzy_add command
* Display weight of symbols correctly
-rw-r--r--src/filter.c2
-rw-r--r--src/main.h2
-rw-r--r--src/plugins/fuzzy_check.c3
-rw-r--r--src/worker.c12
4 files changed, 15 insertions, 4 deletions
diff --git a/src/filter.c b/src/filter.c
index d5e127b7a..9e2da0c57 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -97,7 +97,7 @@ insert_metric_result (struct worker_task *task, struct metric *metric, const cha
memory_pool_add_destructor (task->task_pool, (pool_destruct_func) g_list_free, s->options);
}
- s->score = w;
+ s->score += w;
}
else {
s = memory_pool_alloc (task->task_pool, sizeof (struct symbol));
diff --git a/src/main.h b/src/main.h
index 697c63f47..091daf168 100644
--- a/src/main.h
+++ b/src/main.h
@@ -257,6 +257,8 @@ struct worker_task* construct_task (struct rspamd_worker *worker);
* Destroy task object and remove its IO dispatcher if it exists
*/
void free_task (struct worker_task *task, gboolean is_soft);
+void free_task_hard (gpointer ud);
+void free_task_soft (gpointer ud);
/**
* If set, reopen log file on next write
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index 49b9b976e..9142ca49e 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -718,7 +718,8 @@ fuzzy_process_handler (struct controller_session *session, f_str_t * in)
}
}
- free_task (task, FALSE);
+ memory_pool_add_destructor (session->session_pool, (pool_destruct_func)free_task_soft, task);
+
if (*saved == 0) {
session->state = STATE_REPLY;
r = rspamd_snprintf (out_buf, sizeof (out_buf), "no hashes written" CRLF);
diff --git a/src/worker.c b/src/worker.c
index 15b73e2c7..d249843b8 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -277,8 +277,16 @@ free_task (struct worker_task *task, gboolean is_soft)
}
}
-static void
-free_task_hard (void *ud)
+void
+free_task_hard (gpointer ud)
+{
+ struct worker_task *task = ud;
+
+ free_task (task, FALSE);
+}
+
+void
+free_task_soft (gpointer ud)
{
struct worker_task *task = ud;