From e9c6d8921cce940e590f763a881794323a9e6703 Mon Sep 17 00:00:00 2001 From: bertrand Date: Tue, 3 Aug 1999 10:19:39 +0000 Subject: Multipart Mime message parsing works with plain text parts. Woohooo :)))) Making it work with other types is now just a matter of writing the various data wrappers. And display them will just be a matter of writing the good bonobo components. 1999-08-03 bertrand * camel/camel-simple-data-wrapper.c (_construct_from_stream): more debugging output + nb_bytes_read is now a signed int to avoid bug when eos is encountered. * camel/camel-mime-part.c (_construct_from_stream): sync to data_wrapper_repository function name changes. Use default "text/plain" type when conten-type field is not found. (following RFC 2046 spec). * camel/data-wrapper-repository.c (data_wrapper_repository_set_data_wrapper_type): (data_wrapper_repository_get_data_wrapper_type): change function name prefix (s/data_wrapper/data_wrapper_repository/) * camel/camel-multipart.c (_read_part): add `\n` at eol but not before boundary. * camel/gmime-utils.c (get_header_table_from_stream): correct implementation of end of stream detection. svn path=/trunk/; revision=1070 --- camel/camel-mime-part.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'camel/camel-mime-part.c') diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c index 8a3637afa7..bdb36f6748 100644 --- a/camel/camel-mime-part.c +++ b/camel/camel-mime-part.c @@ -753,16 +753,21 @@ _construct_from_stream (CamelDataWrapper *data_wrapper, CamelStream *stream) CAMEL_LOG_FULL_DEBUG ("CamelMimePart::construct_from_stream parsing content\n"); content_type = camel_mime_part_get_content_type (mime_part); mime_type = gmime_content_field_get_mime_type (content_type); - if (mime_type) { - content_object_type = data_wrapper_get_data_wrapper_type (mime_type); + if (!mime_type) { + CAMEL_LOG_FULL_DEBUG ("CamelMimePart::construct_from_stream content type field not found " + "using default \"text/plain\"\n"); + mime_type = g_strdup ("text/plain"); + camel_mime_part_set_content_type (mime_part, mime_type); + } + content_object_type = data_wrapper_repository_get_data_wrapper_type (mime_type); CAMEL_LOG_FULL_DEBUG ("CamelMimePart::construct_from_stream content type object type used: %s\n", gtk_type_name (content_object_type)); g_free (mime_type); content_object = CAMEL_DATA_WRAPPER (gtk_type_new (content_object_type)); camel_mime_part_set_content_object (mime_part, content_object); camel_data_wrapper_construct_from_stream (content_object, stream); - } else - CAMEL_LOG_FULL_DEBUG ("CamelMimePart::construct_from_stream content type field not found\n"); + + CAMEL_LOG_FULL_DEBUG ("CamelMimePart::construct_from_stream content parsed\n"); -- cgit v1.2.3