summaryrefslogtreecommitdiffstats
path: root/src/libserver/task.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-03 17:10:34 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-03 17:10:34 +0000
commit45e84668a1c7a7131db53e2b94375cfc98d68556 (patch)
tree6f39b6fa4420d7476bff5c91a6c99998063358ec /src/libserver/task.c
parentb279f5c311ad4a454f9aef1f373d88bd2aed9b81 (diff)
downloadrspamd-45e84668a1c7a7131db53e2b94375cfc98d68556.tar.gz
rspamd-45e84668a1c7a7131db53e2b94375cfc98d68556.zip
Start new era of regexp cache
Diffstat (limited to 'src/libserver/task.c')
-rw-r--r--src/libserver/task.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libserver/task.c b/src/libserver/task.c
index eea9057ee..2f4d7ad89 100644
--- a/src/libserver/task.c
+++ b/src/libserver/task.c
@@ -67,10 +67,7 @@ rspamd_task_new (struct rspamd_worker *worker, struct rspamd_config *cfg)
rspamd_mempool_add_destructor (new_task->task_pool,
(rspamd_mempool_destruct_t) g_hash_table_unref,
new_task->results);
- new_task->re_cache = g_hash_table_new (rspamd_str_hash, rspamd_str_equal);
- rspamd_mempool_add_destructor (new_task->task_pool,
- (rspamd_mempool_destruct_t) g_hash_table_unref,
- new_task->re_cache);
+ new_task->re_rt = rspamd_re_cache_runtime_new (cfg->re_cache);
new_task->raw_headers = g_hash_table_new (rspamd_strcase_hash,
rspamd_strcase_equal);
new_task->request_headers = g_hash_table_new_full (rspamd_ftok_icase_hash,
@@ -226,6 +223,7 @@ rspamd_task_free (struct rspamd_task *task)
event_del (&task->timeout_ev);
}
+ rspamd_re_cache_runtime_destroy (task->re_rt);
REF_RELEASE (task->cfg);
rspamd_mempool_delete (task->task_pool);