diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-25 15:07:39 +0200 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-25 15:42:08 +0200 |
commit | d73315f9bbeead0a7dd5a2ff50463f675a2b404b (patch) | |
tree | 3af31bd6b5833418b9dbd0373330b3f9172f1295 | |
parent | d31ea27e06c254fe1a8b9e5e9df022563e88c07c (diff) | |
download | rspamd-d73315f9bbeead0a7dd5a2ff50463f675a2b404b.tar.gz rspamd-d73315f9bbeead0a7dd5a2ff50463f675a2b404b.zip |
[Fix] Process headers only once
-rw-r--r-- | src/libmime/message.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c index 5028e7cc2..ca05dc4c8 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -86,6 +86,7 @@ process_raw_headers (struct rspamd_task *task, GHashTable *target, end = p + len; c = p; memset (nlines_count, 0, sizeof (nlines_count)); + msg_debug_task ("start processing headers"); while (p < end) { /* FSM for processing headers */ @@ -1169,7 +1170,13 @@ mime_foreach_callback (GMimeObject * part, gpointer user_data) mime_part = rspamd_mempool_alloc0 (task->task_pool, sizeof (struct rspamd_mime_part)); - hdrs = g_mime_object_get_headers (GMIME_OBJECT (part)); + if (md->parent != NULL) { + hdrs = g_mime_object_get_headers (GMIME_OBJECT (part)); + } + else { + hdrs = NULL; + } + mime_part->raw_headers = g_hash_table_new_full (rspamd_strcase_hash, rspamd_strcase_equal, NULL, rspamd_ptr_array_free_hard); |