[evolution-data-server] Improve error handling in imapx_server_get_message().



commit cb048105f08625cf504bd8a539cafeccc92ba89e
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.

 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 15bfc0a..e3a8f45 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -7438,12 +7438,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]