aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part.c
diff options
context:
space:
mode:
authorBertrand Guiheneuf <bertrand@src.gnome.org>1999-06-22 00:46:58 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-06-22 00:46:58 +0800
commit4f689d0fb8e33e91fec8b8e0471d48f1e6993622 (patch)
treeb7f6adc3bdf3df1e76dc832d3e56e2f0c098a840 /camel/camel-mime-part.c
parent1703ec52d776954d5da61413b09a82f81b46dd02 (diff)
downloadgsoc2013-evolution-4f689d0fb8e33e91fec8b8e0471d48f1e6993622.tar
gsoc2013-evolution-4f689d0fb8e33e91fec8b8e0471d48f1e6993622.tar.gz
gsoc2013-evolution-4f689d0fb8e33e91fec8b8e0471d48f1e6993622.tar.bz2
gsoc2013-evolution-4f689d0fb8e33e91fec8b8e0471d48f1e6993622.tar.lz
gsoc2013-evolution-4f689d0fb8e33e91fec8b8e0471d48f1e6993622.tar.xz
gsoc2013-evolution-4f689d0fb8e33e91fec8b8e0471d48f1e6993622.tar.zst
gsoc2013-evolution-4f689d0fb8e33e91fec8b8e0471d48f1e6993622.zip
sync
svn path=/trunk/; revision=983
Diffstat (limited to 'camel/camel-mime-part.c')
-rw-r--r--camel/camel-mime-part.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 503e303c06..2d294b6b8b 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -36,8 +36,11 @@ typedef enum {
HEADER_CONTENT_ID,
HEADER_ENCODING,
HEADER_CONTENT_MD5,
- HEADER_CONTENT_LANGUAGES
+ HEADER_CONTENT_LANGUAGES,
+ HEADER_CONTENT_TYPE
} CamelHeaderType;
+
+
static GHashTable *header_name_table;
@@ -72,6 +75,9 @@ static void _write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *strea
static gboolean _parse_header_pair (CamelMimePart *mime_part, GString *header_name, GString *header_value);
+/* loads in a hash table the set of header names we */
+/* recognize and associate them with a unique enum */
+/* identifier (see CamelHeaderType above) */
static void
_init_header_name_table()
{
@@ -81,6 +87,7 @@ _init_header_name_table()
g_hash_table_insert (header_name_table, g_string_new ("Content-id"), (gpointer)HEADER_CONTENT_ID);
g_hash_table_insert (header_name_table, g_string_new ("Content-Transfer-Encoding"), (gpointer)HEADER_ENCODING);
g_hash_table_insert (header_name_table, g_string_new ("Content-MD5"), (gpointer)HEADER_CONTENT_MD5);
+ g_hash_table_insert (header_name_table, g_string_new ("Content-Type"), (gpointer)HEADER_CONTENT_TYPE);
}
@@ -165,7 +172,10 @@ _add_header (CamelMimePart *mime_part, GString *header_name, GString *header_val
gboolean header_exists;
GString *old_header_name;
GString *old_header_value;
-
+
+ /* Try to parse the header pair. If it corresponds to something */
+ /* known, the job is done in the parsing routine. If not, */
+ /* we simply add the header in a raw fashion */
if (CMP_CLASS(mime_part)->parse_header_pair (mime_part, header_name, header_value))
return;
header_exists = g_hash_table_lookup_extended (mime_part->headers, header_name,
@@ -604,6 +614,15 @@ _parse_header_pair (CamelMimePart *mime_part, GString *header_name, GString *hea
header_handled = TRUE;
break;
+ case HEADER_CONTENT_TYPE:
+ CAMEL_LOG (FULL_DEBUG,
+ "CamelMimePart::parse_header_pair found HEADER_CONTENT_TYPE: %s\n",
+ header_value->str );
+
+ /* CMP_CLASS(mime_part)->set_content_MD5 (mime_part, header_value); */
+ header_handled = TRUE;
+ break;
+
}