[evolution-data-server] Fix error handling in CamelImapFolder::get_message().



commit 30fc83e0ca015008140222fd9b980a624f1287ad
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Jul 28 23:22:39 2010 -0400

    Fix error handling in CamelImapFolder::get_message().

 camel/providers/imap/camel-imap-folder.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index da76a24..478ed37 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -3291,10 +3291,14 @@ imap_get_message (CamelFolder *folder,
 	  return NULL;
 
 	/* If its cached in full, just get it as is, this is only a shortcut,
-	   since we get stuff from the cache anyway.  It affects a busted connection though. */
-	if ( (stream = camel_imap_folder_fetch_data(imap_folder, uid, "", TRUE, NULL))
-	     && (msg = get_message_simple(imap_folder, uid, stream, error)))
-		goto done;
+	 * since we get stuff from the cache anyway.  It affects a busted
+	 * connection though. */
+	stream = camel_imap_folder_fetch_data (imap_folder, uid, "", TRUE, NULL);
+	if (stream != NULL) {
+		msg = get_message_simple (imap_folder, uid, stream, NULL);
+		if (msg != NULL)
+			goto done;
+	}
 
 	/* All this mess is so we silently retry a fetch if we fail with
 	   service_unavailable, without an (equivalent) mess of gotos */
@@ -3436,6 +3440,10 @@ done:
 				camel_folder_summary_touch (mi->info.summary);
 		}
 	}
+
+	if (local_error != NULL)
+		g_propagate_error (error, local_error);
+
 fail:
 	camel_message_info_free(&mi->info);
 



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