[evolution-data-server] Bug #702709 - Do network background operations only if the CamelSession is online



commit 04501c5a6591530ee58d093735c4293b122a37b7
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jan 21 12:45:56 2014 +0100

    Bug #702709 - Do network background operations only if the CamelSession is online
    
    This may prevent any network background operations, when associated
    CamelSession is offline, like when the machine gets suspended or is
    just resumed.

 camel/camel-network-service.c |    4 ++++
 camel/camel-offline-store.c   |    8 ++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-network-service.c b/camel/camel-network-service.c
index 0d191d2..fb18d6c 100644
--- a/camel/camel-network-service.c
+++ b/camel/camel-network-service.c
@@ -507,6 +507,10 @@ network_service_update_host_reachable (CamelNetworkService *service)
        priv = CAMEL_NETWORK_SERVICE_GET_PRIVATE (service);
 
        session = camel_service_ref_session (CAMEL_SERVICE (service));
+       if (!camel_session_get_online (session)) {
+               g_object_unref (session);
+               return;
+       }
 
        g_mutex_lock (&priv->update_host_reachable_lock);
 
diff --git a/camel/camel-offline-store.c b/camel/camel-offline-store.c
index 839be01..3a75e0d 100644
--- a/camel/camel-offline-store.c
+++ b/camel/camel-offline-store.c
@@ -216,6 +216,14 @@ camel_offline_store_set_online_sync (CamelOfflineStore *store,
        }
 
        if (host_reachable) {
+               CamelSession *session;
+
+               session = camel_service_ref_session (service);
+               host_reachable = camel_session_get_online (session);
+               g_clear_object (&session);
+       }
+
+       if (host_reachable) {
                GPtrArray *folders;
                guint ii;
 


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