]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add flags for content-type
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 12 Dec 2016 15:43:05 +0000 (15:43 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 12 Dec 2016 15:43:35 +0000 (15:43 +0000)
src/libmime/content_type.c
src/libmime/content_type.h

index 934c12eab7087c1f84c0a1015fcb7a3ee5cd1a41..e04f2bc158d584b81e492a540836f711edddb2c3 100644 (file)
@@ -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;
 
index 7c129936db70cfa310534c39f7c3fcf6d7da3338..f26e2f4a03236d830958902c26324ed14d99787c 100644 (file)
 #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 */
 };