From 2ce4eb74b65f3e9d07a921aad3899a7141b0000f Mon Sep 17 00:00:00 2001 From: NotZed Date: Fri, 19 May 2000 19:58:41 +0000 Subject: > searchpart = strchr(namepart, '?'); 2000-05-19 NotZed * camel-simple-data-wrapper.c (construct_from_stream): If we already have been constructed, unref our content. (write_to_stream): Check we've been constructued, and change for stream api changes. * camel-mime-parser.c: Removed exception stuff. * md5-utils.c (md5_get_digest_from_stream): repaired. * camel-mime-message.c: Remove exception from write_to_stream, and fix, and fix formatting. * providers/sendmail/camel-sendmail-transport.c (_send_internal): Fix for stream changes. * providers/pop3/camel-pop3-store.c (camel_pop3_command): Fixes for stream changes. * providers/mbox/camel-mbox-folder.c, and elsewhere, fix all stream api changes. (mbox_append_message): Use stream_close() now its back. (mbox_append_message): unref the from filter. * camel-stream-mem.c: And here. * camel-stream-fs.[ch]: Here too. * camel-stream-filter.c: Likewise. This is getting tedious. * camel-stream-buffer.c (stream_write): Fix a few little problems. (stream_close): Reimplmeent. (camel_stream_buffer_read_line): Slightly more efficient version, that also only allocates the right amount of memory for strings. * camel-seekable-substream.c: Likewise. * camel-seekable-stream.[ch]: Remove exceptions, fix formatting, changes for stream (re)fixes. set_bounds returns an error. * camel-stream.[ch]: Remove exceptions. Make flush and reset return an error code, repair all the screwed up formatting, and put back close. * camel-mime-part-utils.c (camel_mime_part_construct_content_from_parser): And here. * camel-mime-part.c (camel_mime_part_set_content): And this too. (write_to_stream): Fixed for stream changes. * camel.h: Fixed. * providers/vee/camel-vee-folder.c (vee_search_by_expression): Implement. Performs an intersection of the two searches. (camel_vee_folder_finalise): Unref search folders. (vee_append_message): Implement append. svn path=/trunk/; revision=3142 --- camel/camel-mime-part.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'camel/camel-mime-part.c') diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c index e79edaa3dd..d727c98811 100644 --- a/camel/camel-mime-part.c +++ b/camel/camel-mime-part.c @@ -66,9 +66,7 @@ static CamelMediumClass *parent_class=NULL; static void finalize (GtkObject *object); /* from CamelDataWrapper */ -static int write_to_stream (CamelDataWrapper *data_wrapper, - CamelStream *stream, - CamelException *ex); +static int write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream); static int construct_from_stream (CamelDataWrapper *dw, CamelStream *s); /* from CamelMedia */ @@ -480,13 +478,13 @@ set_content_object (CamelMedium *medium, CamelDataWrapper *content) /**********************************************************************/ static int -write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream, - CamelException *ex) +write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream) { CamelMimePart *mp = CAMEL_MIME_PART (data_wrapper); CamelMedium *medium = CAMEL_MEDIUM (data_wrapper); CamelDataWrapper *content; int total = 0; + int count; d(printf("mime_part::write_to_stream\n")); @@ -497,19 +495,18 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream, if (mp->headers) { struct _header_raw *h = mp->headers; while (h) { - total += camel_stream_printf (stream, ex, "%s%s%s\n", - h->name, - isspace(h->value[0]) ? ":" : ": ", - h->value); - if (camel_exception_is_set (ex)) + count = camel_stream_printf(stream, "%s%s%s\n", h->name, isspace(h->value[0]) ? ":" : ": ", h->value); + if (count == -1) return -1; + total += count; h = h->next; } } - total += camel_stream_write (stream, "\n", 1, ex); - if (camel_exception_is_set (ex)) + count = camel_stream_write (stream, "\n", 1); + if (count == -1) return -1; + total += count; content = camel_medium_get_content_object (medium); if (content) { @@ -537,11 +534,12 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream, } #endif - total += camel_data_wrapper_write_to_stream (content, stream, ex); + count = camel_data_wrapper_write_to_stream (content, stream); if (filter_stream) gtk_object_unref((GtkObject *)filter_stream); - if (camel_exception_is_set (ex)) + if (count == -1) return -1; + total += count; } else { g_warning("No content for medium, nothing to write"); } @@ -692,7 +690,7 @@ camel_mime_part_set_content (CamelMimePart *camel_mime_part, CamelDataWrapper *dw; CamelStream *stream; - dw = camel_simple_data_wrapper_new (); + dw = camel_data_wrapper_new (); camel_data_wrapper_set_mime_type (dw, type); stream = camel_stream_mem_new_with_buffer (data, length); camel_data_wrapper_construct_from_stream (dw, stream); -- cgit v1.2.3