aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-05-12 04:57:26 +0800
committerDan Winship <danw@src.gnome.org>2001-05-12 04:57:26 +0800
commitba099582f365aa886cf426c4b7c422244ccec2e4 (patch)
tree048f51bf50cc32bba92dad2ca6ef2fe0ede0af86 /camel/camel-mime-part.c
parent96dab8cb1934bfd4d0240d1aa9c2ca0e45a9edbb (diff)
downloadgsoc2013-evolution-ba099582f365aa886cf426c4b7c422244ccec2e4.tar.gz
gsoc2013-evolution-ba099582f365aa886cf426c4b7c422244ccec2e4.tar.zst
gsoc2013-evolution-ba099582f365aa886cf426c4b7c422244ccec2e4.zip
Decode Content-Location, either correctly or Netscape-generated-brokenly.
* camel-mime-utils.c (header_location_decode): Decode Content-Location, either correctly or Netscape-generated-brokenly. * camel-mime-part.c (camel_mime_part_set_content_location, camel_mime_part_get_content_location, etc): Deal with Content-Location header. svn path=/trunk/; revision=9772
Diffstat (limited to 'camel/camel-mime-part.c')
-rw-r--r--camel/camel-mime-part.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index e62f7cce27..956e0c1554 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -51,6 +51,7 @@ typedef enum {
HEADER_CONTENT_ID,
HEADER_ENCODING,
HEADER_CONTENT_MD5,
+ HEADER_CONTENT_LOCATION,
HEADER_CONTENT_LANGUAGES,
HEADER_CONTENT_TYPE
} CamelHeaderType;
@@ -97,6 +98,7 @@ init_header_name_table()
g_hash_table_insert (header_name_table, "Content-id", (gpointer)HEADER_CONTENT_ID);
g_hash_table_insert (header_name_table, "Content-Transfer-Encoding", (gpointer)HEADER_ENCODING);
g_hash_table_insert (header_name_table, "Content-MD5", (gpointer)HEADER_CONTENT_MD5);
+ g_hash_table_insert (header_name_table, "Content-Location", (gpointer)HEADER_CONTENT_LOCATION);
g_hash_table_insert (header_name_table, "Content-Type", (gpointer)HEADER_CONTENT_TYPE);
header_formatted_table = g_hash_table_new(g_strcase_hash, g_strcase_equal);
@@ -141,6 +143,7 @@ camel_mime_part_init (gpointer object, gpointer klass)
camel_mime_part->disposition = NULL;
camel_mime_part->content_id = NULL;
camel_mime_part->content_MD5 = NULL;
+ camel_mime_part->content_location = NULL;
camel_mime_part->content_languages = NULL;
camel_mime_part->encoding = CAMEL_MIME_PART_ENCODING_DEFAULT;
}
@@ -154,6 +157,7 @@ camel_mime_part_finalize (CamelObject *object)
g_free (mime_part->description);
g_free (mime_part->content_id);
g_free (mime_part->content_MD5);
+ g_free (mime_part->content_location);
string_list_free (mime_part->content_languages);
header_disposition_unref(mime_part->disposition);
@@ -221,6 +225,10 @@ process_header(CamelMedium *medium, const char *header_name, const char *header_
g_free(mime_part->content_MD5);
mime_part->content_MD5 = g_strdup(header_value);
break;
+ case HEADER_CONTENT_LOCATION:
+ g_free(mime_part->content_location);
+ mime_part->content_location = header_location_decode(header_value);
+ break;
case HEADER_CONTENT_TYPE:
if (mime_part->content_type)
header_content_type_unref (mime_part->content_type);
@@ -404,6 +412,20 @@ camel_mime_part_get_content_MD5 (CamelMimePart *mime_part)
return mime_part->content_MD5;
}
+/* **** Content-MD5: */
+
+void
+camel_mime_part_set_content_location (CamelMimePart *mime_part, const char *location)
+{
+ camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-Location", location);
+}
+
+const gchar *
+camel_mime_part_get_content_location (CamelMimePart *mime_part)
+{
+ return mime_part->content_location;
+}
+
/* **** Content-Transfer-Encoding: */
void