summaryrefslogtreecommitdiffstats
path: root/src/libmime
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-12-16 16:38:59 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-12-16 16:38:59 +0000
commit6aedc80226e3cbcb040f79c936933093d92de9da (patch)
tree9aee3e7af0ec43ef5afeca47357f3da744e9d311 /src/libmime
parentca837465f99c363e3707c40b4200036a0c85db27 (diff)
downloadrspamd-6aedc80226e3cbcb040f79c936933093d92de9da.tar.gz
rspamd-6aedc80226e3cbcb040f79c936933093d92de9da.zip
[Rework|Minor] More updates for mime parsing
Diffstat (limited to 'src/libmime')
-rw-r--r--src/libmime/message.h10
-rw-r--r--src/libmime/mime_parser.c6
2 files changed, 8 insertions, 8 deletions
diff --git a/src/libmime/message.h b/src/libmime/message.h
index 66981ca9e..c4f0e7a8e 100644
--- a/src/libmime/message.h
+++ b/src/libmime/message.h
@@ -36,6 +36,10 @@ enum rspamd_cte {
struct rspamd_mime_text_part;
+struct rspamd_mime_multipart {
+ GPtrArray *children;
+};
+
struct rspamd_mime_part {
struct rspamd_content_type *ct;
struct rspamd_content_disposition *cd;
@@ -48,7 +52,7 @@ struct rspamd_mime_part {
enum rspamd_cte cte;
union {
- struct rspamd_mime_multipart *mp;
+ struct rspamd_mime_multipart mp;
struct rspamd_mime_text_part *txt;
struct rspamd_image *img;
struct rspamd_archive *arch;
@@ -58,10 +62,6 @@ struct rspamd_mime_part {
guchar digest[rspamd_cryptobox_HASHBYTES];
};
-struct rspamd_mime_multipart {
- GPtrArray *children;
-};
-
#define RSPAMD_MIME_TEXT_PART_FLAG_UTF (1 << 0)
#define RSPAMD_MIME_TEXT_PART_FLAG_BALANCED (1 << 1)
#define RSPAMD_MIME_TEXT_PART_FLAG_EMPTY (1 << 2)
diff --git a/src/libmime/mime_parser.c b/src/libmime/mime_parser.c
index 7586a803e..0b192b8d5 100644
--- a/src/libmime/mime_parser.c
+++ b/src/libmime/mime_parser.c
@@ -341,8 +341,8 @@ rspamd_mime_process_multipart_node (struct rspamd_task *task,
hdr_pos = rspamd_string_find_eoh (&str, &body_pos);
- if (multipart->children == NULL) {
- multipart->children = g_ptr_array_sized_new (2);
+ if (multipart->specific.mp.children == NULL) {
+ multipart->specific.mp.children = g_ptr_array_sized_new (2);
}
npart = rspamd_mempool_alloc0 (task->task_pool,
@@ -350,7 +350,7 @@ rspamd_mime_process_multipart_node (struct rspamd_task *task,
npart->parent_part = multipart;
npart->raw_headers = g_hash_table_new_full (rspamd_strcase_hash,
rspamd_strcase_equal, NULL, rspamd_ptr_array_free_hard);
- g_ptr_array_add (multipart->children, npart);
+ g_ptr_array_add (multipart->specific.mp.children, npart);
if (hdr_pos > 0 && hdr_pos < str.len) {
npart->raw_headers_str = str.str;