[evolution-data-server/gnome-3-8] Improve error handling in imapx_server_get_message().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-8] Improve error handling in imapx_server_get_message().
- Date: Wed, 24 Apr 2013 14:36:42 +0000 (UTC)
commit c134edcbdda4ab813a50fb2b47c7e3287f8766c1
Author: Matthew Barnes <mbarnes redhat com>
Date: Wed Apr 24 10:09:09 2013 -0400
Improve error handling in imapx_server_get_message().
If a GET_MESSAGE job for the same UID is already in progress, wait for
the job to finish, but don't assume it was successful. Try retrieving
the message from cache, but if that fails then we have to re-fetch the
message from the IMAP server.
(cherry picked from commit cb048105f08625cf504bd8a539cafeccc92ba89e)
camel/camel-imapx-server.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index 56244a0..4421e9a 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -7440,12 +7440,15 @@ imapx_server_get_message (CamelIMAPXServer *is,
/* Wait for the job to finish. */
camel_imapx_job_wait (job);
+ /* Disregard errors here. If we failed to retreive the
+ * message from cache (implying the job we were waiting
+ * on failed or got cancelled), we'll just re-fetch it. */
stream = camel_data_cache_get (
- ifolder->cache, "cur", uid, error);
- if (stream == NULL)
- g_prefix_error (
- error, "Could not retrieve the message: ");
- return stream;
+ ifolder->cache, "cur", uid, NULL);
+ if (stream != NULL)
+ return stream;
+
+ QUEUE_LOCK (is);
}
mi = camel_folder_summary_get (folder->summary, uid);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]