aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-02-28 10:28:12 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-02-28 10:28:12 +0800
commite1fa571225dcf92a75e3ff4a84c7153e32b3664f (patch)
tree39c9b03cde721b756f11925e5c411b557e883321 /camel/camel-mime-part.c
parent7ac88d86319e2ef5b43ad7413f759bd1423ecd21 (diff)
downloadgsoc2013-evolution-e1fa571225dcf92a75e3ff4a84c7153e32b3664f.tar
gsoc2013-evolution-e1fa571225dcf92a75e3ff4a84c7153e32b3664f.tar.gz
gsoc2013-evolution-e1fa571225dcf92a75e3ff4a84c7153e32b3664f.tar.bz2
gsoc2013-evolution-e1fa571225dcf92a75e3ff4a84c7153e32b3664f.tar.lz
gsoc2013-evolution-e1fa571225dcf92a75e3ff4a84c7153e32b3664f.tar.xz
gsoc2013-evolution-e1fa571225dcf92a75e3ff4a84c7153e32b3664f.tar.zst
gsoc2013-evolution-e1fa571225dcf92a75e3ff4a84c7153e32b3664f.zip
Don't #include camel-mime-filter-save.h, we don't use it.
2002-02-27 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-summary.h: Don't #include camel-mime-filter-save.h, we don't use it. * camel-file-utils.c: Fixed a few 'might be used uninitialized' warnings which were real problems. * camel-mime-part-utils.c (camel_mime_part_construct_content_from_parser): Save the raw mime stream for any/all signed parts. * camel-mime-part.c (camel_mime_part_init): Initialize our raw stream to NULL. (camel_mime_part_finalize): Unref our raw stream, if we have one. (write_to_stream): If we have a raw stream, write that out instead of re-encoding. * camel-mime-filter-save.[c,h]: Rewritten to save to a stream rather than a file. svn path=/trunk/; revision=15867
Diffstat (limited to 'camel/camel-mime-part.c')
-rw-r--r--camel/camel-mime-part.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 5a58b79009..c7b21e460d 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -156,6 +156,7 @@ camel_mime_part_init (gpointer object, gpointer klass)
CamelMimePart *camel_mime_part = CAMEL_MIME_PART (object);
camel_mime_part->content_type = header_content_type_new ("text", "plain");
+ camel_mime_part->stream = NULL;
camel_mime_part->description = NULL;
camel_mime_part->disposition = NULL;
camel_mime_part->content_id = NULL;
@@ -170,7 +171,10 @@ static void
camel_mime_part_finalize (CamelObject *object)
{
CamelMimePart *mime_part = CAMEL_MIME_PART (object);
-
+
+ if (mime_part->stream)
+ camel_object_unref (CAMEL_OBJECT (mime_part->stream));
+
g_free (mime_part->description);
g_free (mime_part->content_id);
g_free (mime_part->content_MD5);
@@ -667,6 +671,18 @@ write_to_stream(CamelDataWrapper *data_wrapper, CamelStream *stream)
if (count == -1)
return -1;
total += count;
+
+#define SAVE_RAW_MIME_STREAM_FOR_SECURE_MIME_SIGNATURES
+#ifdef SAVE_RAW_MIME_STREAM_FOR_SECURE_MIME_SIGNATURES
+ if (mp->stream) {
+ count = camel_stream_write_to_stream (mp->stream, stream);
+ camel_stream_reset (mp->stream);
+ if (count == -1)
+ return -1;
+
+ return total + count;
+ }
+#endif /* SAVE_RAW_MIME_STREAM_FOR_SECURE_MIME_SIGNATURES */
content = camel_medium_get_content_object(medium);
if (content) {