[evolution-data-server/gnome-3-8] Bug #705617 - Failed connection hides offline data in online mode



commit 63c3a90041cb6795fef32acbe43dad6275de1edc
Author: Milan Crha <mcrha redhat com>
Date:   Thu Aug 8 13:52:17 2013 +0200

    Bug #705617 - Failed connection hides offline data in online mode
    
    Do not call "connect" when changing online state in 'connecting' state,
    and similar for "disconnect", to prevent a deadlock, if this change is
    called within "connect" or "disconnect" function itself.

 camel/camel-offline-store.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/camel/camel-offline-store.c b/camel/camel-offline-store.c
index b4e8050..f7d3dc7 100644
--- a/camel/camel-offline-store.c
+++ b/camel/camel-offline-store.c
@@ -142,8 +142,11 @@ camel_offline_store_set_online_sync (CamelOfflineStore *store,
        /* Returning to online mode is the simpler case. */
        if (!store_is_online) {
                store->priv->online = online;
-               return camel_service_connect_sync (
-                       service, cancellable, error);
+
+               if (camel_service_get_connection_status (service) == CAMEL_SERVICE_CONNECTING)
+                       return TRUE;
+
+               return camel_service_connect_sync (service, cancellable, error);
        }
 
        /* network available -> network unavailable */
@@ -178,8 +181,10 @@ camel_offline_store_set_online_sync (CamelOfflineStore *store,
                        CAMEL_STORE (store), FALSE, cancellable, NULL);
        }
 
-       success = camel_service_disconnect_sync (
-               service, network_available, cancellable, error);
+       if (camel_service_get_connection_status (service) == CAMEL_SERVICE_DISCONNECTING)
+               success = TRUE;
+       else
+               success = camel_service_disconnect_sync (service, network_available, cancellable, error);
 
        store->priv->online = online;
 


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