From: Vsevolod Stakhov Date: Mon, 12 Dec 2016 15:43:05 +0000 (+0000) Subject: [Minor] Add flags for content-type X-Git-Tag: 1.5.0~615 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74749d1ddda9b55c44fe0f5b5dee0e572a216bf4;p=thirdparty%2Frspamd.git [Minor] Add flags for content-type --- diff --git a/src/libmime/content_type.c b/src/libmime/content_type.c index 934c12eab7..e04f2bc158 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 7c129936db..f26e2f4a03 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 */ };