[evolution-patches] 69339, broken multipart/related not showing as attachment




The workaround code was writing the attachment headers to a closed stream - so they weren't showing.

The code has a slight risk of showing stuff both inline and as attachments - but whether it does or not depends somewhat on the internals of gtkhtml.  'it shouldn't happen'.

--
Michael Zucchi <notzed ximian com>
"Free Software, putting the Free back in Free Market."
Novell's Evolution and Free Software Developer
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3444.2.26
diff -u -p -r1.3444.2.26 ChangeLog
--- mail/ChangeLog	19 Nov 2004 00:45:55 -0000	1.3444.2.26
+++ mail/ChangeLog	19 Nov 2004 07:35:41 -0000
@@ -1,3 +1,11 @@
+2004-11-19  Not Zed  <NotZed Ximian com>
+
+	** See bug #69339.
+
+	* em-format-html.c (efh_format_do): close the stream/html after we're
+	finished, since the multipart/related stuff may write more content
+	for orphaned attachments.
+
 2004-11-10  Not Zed  <NotZed Ximian com>
 
 	** See bug #68794.
Index: mail/em-format-html.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-format-html.c,v
retrieving revision 1.63.4.3
diff -u -p -r1.63.4.3 em-format-html.c
--- mail/em-format-html.c	3 Nov 2004 02:29:56 -0000	1.63.4.3
+++ mail/em-format-html.c	19 Nov 2004 07:35:42 -0000
@@ -71,7 +71,7 @@
 #include "em-html-stream.h"
 #include "em-utils.h"
 
-#define d(x) 
+#define d(x)
 
 #define EFH_TABLE_OPEN "<table>"
 
@@ -1184,10 +1184,7 @@ static void efh_format_do(struct _mail_m
 		em_format_format_message((EMFormat *)m->format, (CamelStream *)m->estream, (CamelMedium *)m->message);
 	}
 
-	camel_stream_write_string((CamelStream *)m->estream, "</body>\n</html>\n");
-	camel_stream_close((CamelStream *)m->estream);
-	camel_object_unref(m->estream);
-	m->estream = NULL;
+	camel_stream_flush((CamelStream *)m->estream);
 
 	puri_level = ((EMFormat *)m->format)->pending_uri_level;
 	base = ((EMFormat *)m->format)->base;
@@ -1222,6 +1219,11 @@ static void efh_format_do(struct _mail_m
 	}
 	g_mutex_unlock(m->format->priv->lock);
 	d(printf("out of jobs, done\n"));
+
+	camel_stream_write_string((CamelStream *)m->estream, "</body>\n</html>\n");
+	camel_stream_close((CamelStream *)m->estream);
+	camel_object_unref(m->estream);
+	m->estream = NULL;
 
 	((EMFormat *)m->format)->pending_uri_level = puri_level;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]