aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/task.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-04-03 18:00:01 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-04-03 18:00:01 +0100
commit58e6cb1a4fce75ef521233bd734a7706b2f5e26f (patch)
treee4719206bd4ec1743f1cede24a4f29572231cf99 /src/libserver/task.c
parente1a378c031958b5ee10abd74e11683984a762c25 (diff)
downloadrspamd-58e6cb1a4fce75ef521233bd734a7706b2f5e26f.tar.gz
rspamd-58e6cb1a4fce75ef521233bd734a7706b2f5e26f.zip
[Feature] Store headers order
Diffstat (limited to 'src/libserver/task.c')
-rw-r--r--src/libserver/task.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/libserver/task.c b/src/libserver/task.c
index cbd9a7a31..d2313afd7 100644
--- a/src/libserver/task.c
+++ b/src/libserver/task.c
@@ -90,6 +90,7 @@ rspamd_task_new (struct rspamd_worker *worker, struct rspamd_config *cfg)
new_task->raw_headers = g_hash_table_new_full (rspamd_strcase_hash,
rspamd_strcase_equal, NULL, rspamd_ptr_array_free_hard);
+ new_task->headers_order = g_queue_new ();
new_task->request_headers = g_hash_table_new_full (rspamd_ftok_icase_hash,
rspamd_ftok_icase_equal, rspamd_fstring_mapped_ftok_free,
rspamd_request_header_dtor);
@@ -100,19 +101,22 @@ rspamd_task_new (struct rspamd_worker *worker, struct rspamd_config *cfg)
rspamd_ftok_icase_equal, rspamd_fstring_mapped_ftok_free,
rspamd_fstring_mapped_ftok_free);
rspamd_mempool_add_destructor (new_task->task_pool,
- (rspamd_mempool_destruct_t) g_hash_table_unref,
- new_task->reply_headers);
+ (rspamd_mempool_destruct_t) g_hash_table_unref,
+ new_task->reply_headers);
rspamd_mempool_add_destructor (new_task->task_pool,
- (rspamd_mempool_destruct_t) g_hash_table_unref,
- new_task->raw_headers);
+ (rspamd_mempool_destruct_t) g_hash_table_unref,
+ new_task->raw_headers);
+ rspamd_mempool_add_destructor (new_task->task_pool,
+ (rspamd_mempool_destruct_t) g_queue_free,
+ new_task->headers_order);
new_task->emails = g_hash_table_new (rspamd_email_hash, rspamd_emails_cmp);
rspamd_mempool_add_destructor (new_task->task_pool,
- (rspamd_mempool_destruct_t) g_hash_table_unref,
- new_task->emails);
+ (rspamd_mempool_destruct_t) g_hash_table_unref,
+ new_task->emails);
new_task->urls = g_hash_table_new (rspamd_url_hash, rspamd_urls_cmp);
rspamd_mempool_add_destructor (new_task->task_pool,
- (rspamd_mempool_destruct_t) g_hash_table_unref,
- new_task->urls);
+ (rspamd_mempool_destruct_t) g_hash_table_unref,
+ new_task->urls);
new_task->parts = g_ptr_array_sized_new (4);
rspamd_mempool_add_destructor (new_task->task_pool,
rspamd_ptr_array_free_hard, new_task->parts);
@@ -208,6 +212,8 @@ rspamd_task_free (struct rspamd_task *task)
g_hash_table_unref (p->raw_headers);
}
+ g_queue_free (p->headers_order);
+
if (IS_CT_MULTIPART (p->ct)) {
if (p->specific.mp.children) {
g_ptr_array_free (p->specific.mp.children, TRUE);