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



commit 65efdc0b20fe35f1894e5006f3542162d8872486
Author: Milan Crha <mcrha redhat com>
Date:   Thu Aug 8 13:46:44 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 |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/camel/camel-offline-store.c b/camel/camel-offline-store.c
index 280dbcb..edb1418 100644
--- a/camel/camel-offline-store.c
+++ b/camel/camel-offline-store.c
@@ -178,8 +178,10 @@ camel_offline_store_set_online_sync (CamelOfflineStore *store,
 
                g_object_notify (G_OBJECT (store), "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 */
@@ -214,8 +216,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]