evolution-mapi r19 - trunk/src/camel



Author: jjohnny
Date: Fri Nov 28 11:39:51 2008
New Revision: 19
URL: http://svn.gnome.org/viewvc/evolution-mapi?rev=19&view=rev

Log:
Fixes Bug 561670. Add boundry to streams.

Modified:
   trunk/src/camel/ChangeLog
   trunk/src/camel/camel-mapi-transport.c

Modified: trunk/src/camel/camel-mapi-transport.c
==============================================================================
--- trunk/src/camel/camel-mapi-transport.c	(original)
+++ trunk/src/camel/camel-mapi-transport.c	Fri Nov 28 11:39:51 2008
@@ -220,6 +220,8 @@
 		dw = camel_medium_get_content_object(CAMEL_MEDIUM(part));
 		content_stream = camel_stream_mem_new();
 		content_size = camel_data_wrapper_decode_to_stream (dw, (CamelStream *) content_stream);
+		camel_stream_write ((CamelStream *) content_stream, "", 1);
+
 		camel_seekable_stream_seek((CamelSeekableStream *)content_stream, 0, CAMEL_STREAM_SET);
 
 		description = camel_mime_part_get_description(part);
@@ -294,16 +296,19 @@
 		if (mapi_do_multipart(CAMEL_MULTIPART(multipart), item))
 			printf("camel message multi part error\n"); 
 	} else {
-		content_stream = (CamelStream *)camel_stream_mem_new();
 		dw = camel_medium_get_content_object (CAMEL_MEDIUM (message));
-		type = camel_mime_part_get_content_type((CamelMimePart *)message);
-		content_type = camel_content_type_simple (type);
-		content_size = camel_data_wrapper_write_to_stream(dw, (CamelStream *)content_stream);
-		mapi_item_set_body_stream (item, content_stream, PART_TYPE_PLAIN_TEXT);
+		if (dw) {
+			type = camel_mime_part_get_content_type((CamelMimePart *)message);
+			content_type = camel_content_type_simple (type);
+
+			content_stream = (CamelStream *)camel_stream_mem_new();
+			content_size = camel_data_wrapper_write_to_stream(dw, (CamelStream *)content_stream);
+			camel_stream_write ((CamelStream *) content_stream, "", 1);
+
+			mapi_item_set_body_stream (item, content_stream, PART_TYPE_PLAIN_TEXT);
+		}
 	}
 	
-	mapi_item_debug_dump (item);
-
 	/* send */
 	st = mapi_message_item_send(item, attach_list, recipient_list);
 



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