diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-12 15:43:05 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-12 15:43:35 +0000 |
commit | 74749d1ddda9b55c44fe0f5b5dee0e572a216bf4 (patch) | |
tree | 052a6ccefe820fc3b9b840431865f63e00283e4b | |
parent | 1bf7a98c8fc7881496a531765e4302777948f534 (diff) | |
download | rspamd-74749d1ddda9b55c44fe0f5b5dee0e572a216bf4.tar.gz rspamd-74749d1ddda9b55c44fe0f5b5dee0e572a216bf4.zip |
[Minor] Add flags for content-type
-rw-r--r-- | src/libmime/content_type.c | 1 | ||||
-rw-r--r-- | src/libmime/content_type.h | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c index 934c12eab..e04f2bc15 100644 --- a/src/libmime/content_type.c +++ b/src/libmime/content_type.c @@ -83,6 +83,7 @@ rspamd_content_type_parse (const gchar *in, /* Now do some hacks to work with broken content types */ if (res->subtype.len == 0) { + res->flags |= RSPAMD_CONTENT_TYPE_BROKEN; srch.begin = "text"; srch.len = 4; diff --git a/src/libmime/content_type.h b/src/libmime/content_type.h index 7c129936d..f26e2f4a0 100644 --- a/src/libmime/content_type.h +++ b/src/libmime/content_type.h @@ -20,6 +20,11 @@ #include "libutil/fstring.h" #include "libutil/mem_pool.h" +enum rspamd_content_type_flags { + RSPAMD_CONTENT_TYPE_VALID = 0, + RSPAMD_CONTENT_TYPE_BROKEN = 1 << 0, +}; + struct rspamd_content_type_param { rspamd_ftok_t name; rspamd_ftok_t value; @@ -31,6 +36,7 @@ struct rspamd_content_type { rspamd_ftok_t type; rspamd_ftok_t subtype; rspamd_ftok_t charset; + enum rspamd_content_type_flags flags; GHashTable *attrs; /* Can be empty */ }; |