summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-08-08 13:52:17 +0200
committerMilan Crha <mcrha@redhat.com>2013-08-08 13:52:17 +0200
commit63c3a90041cb6795fef32acbe43dad6275de1edc (patch)
tree1bcfbda970bad14c9e1475a872f063086be8e61e
parent809b48f1f1fa3a5f242d311be236a93bb012db53 (diff)
downloadevolution-data-server-63c3a90041cb6795fef32acbe43dad6275de1edc.tar.gz
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.
-rw-r--r--camel/camel-offline-store.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/camel/camel-offline-store.c b/camel/camel-offline-store.c
index b4e805062..f7d3dc75c 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;