diff options
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/mbox/camel-mbox-folder.c | 15 | ||||
-rw-r--r-- | camel/providers/mbox/camel-mbox-summary.c | 2 | ||||
-rw-r--r-- | camel/providers/pop3/camel-pop3-folder.c | 3 |
3 files changed, 13 insertions, 7 deletions
diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c index be02a472c6..91ac79c22e 100644 --- a/camel/providers/mbox/camel-mbox-folder.c +++ b/camel/providers/mbox/camel-mbox-folder.c @@ -676,6 +676,7 @@ _get_message_count (CamelFolder *folder, CamelException *ex) */ /* FIXME: this may need some tweaking for performance? */ +/* FIXME: MUST check all sytem call return codes MUST MUST */ static void _append_message (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex) { @@ -745,7 +746,7 @@ _append_message (CamelFolder *folder, CamelMimeMessage *message, CamelException } /* its not an mbox folder, so lets do it the slow way ... */ - output_stream = camel_stream_fs_new_with_name (mbox_folder->folder_file_path, CAMEL_STREAM_FS_WRITE); + output_stream = camel_stream_fs_new_with_name (mbox_folder->folder_file_path, O_CREAT|O_RDWR, 0600); if (output_stream == NULL) { camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INSUFFICIENT_PERMISSION, /* FIXME: what code? */ @@ -851,14 +852,20 @@ _get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException *ex) /* FIXME: more checks below */ /* create a stream bound to the message position/size */ - message_stream = camel_stream_fs_new_with_name_and_bounds (mbox_folder->folder_file_path, - CAMEL_STREAM_FS_READ, + message_stream = camel_stream_fs_new_with_name_and_bounds (mbox_folder->folder_file_path, O_RDONLY, 0, ((CamelMboxMessageContentInfo *)info->info.content)->pos, ((CamelMboxMessageContentInfo *)info->info.content)->endpos); gtk_object_ref((GtkObject *)message_stream); gtk_object_sink((GtkObject *)message_stream); message = camel_mime_message_new(); - camel_data_wrapper_construct_from_stream((CamelDataWrapper *)message, message_stream); + if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)message, message_stream) == -1) { + gtk_object_unref((GtkObject *)message); + gtk_object_unref((GtkObject *)message_stream); + camel_exception_setv (ex, + CAMEL_EXCEPTION_FOLDER_INVALID_UID, /* FIXME: code */ + "Could not create message for uid %s: %s", uid, strerror(errno)); + return NULL; + } gtk_object_unref((GtkObject *)message_stream); /* init other fields? */ diff --git a/camel/providers/mbox/camel-mbox-summary.c b/camel/providers/mbox/camel-mbox-summary.c index f1d4a41b7d..5608afc3df 100644 --- a/camel/providers/mbox/camel-mbox-summary.c +++ b/camel/providers/mbox/camel-mbox-summary.c @@ -768,7 +768,7 @@ static int index_folder(CamelMboxSummary *s, int startoffset) int docopy = FALSE; /* check for X-Evolution header ... if its there, nothing to do (skip content) */ - xev = camel_mime_parser_header(mp, "x-evolution", &xevoffset); + xev = camel_mime_parser_header(mp, "x-evolution", (int *)&xevoffset); if (xev) { d(printf("An x-evolution header exists at: %d = %s\n", xevoffset + write_offset, xev)); xevoffset = xevoffset + write_offset; diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c index 7653dbdb6b..f47851a6a4 100644 --- a/camel/providers/pop3/camel-pop3-folder.c +++ b/camel/providers/pop3/camel-pop3-folder.c @@ -205,8 +205,7 @@ get_message_by_number (CamelFolder *folder, gint number, CamelException *ex) return NULL; } - msgstream = camel_stream_mem_new_with_buffer (body, strlen (body), - CAMEL_STREAM_MEM_READ); + msgstream = camel_stream_mem_new_with_buffer (body, strlen (body)); msg = camel_mime_message_new (); camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (msg), msgstream); |