[evolution-data-server/gnome-3-10] Bug #702709 - Do network background operations only if the CamelSession is online
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-10] Bug #702709 - Do network background operations only if the CamelSession is online
- Date: Tue, 21 Jan 2014 11:55:35 +0000 (UTC)
commit b81954c21c809493e85f15ae085b25bd192494d0
Author: Milan Crha <mcrha redhat com>
Date: Tue Jan 21 12:53:32 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 | 3 ++-
2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/camel/camel-network-service.c b/camel/camel-network-service.c
index 438540c..52caf93 100644
--- a/camel/camel-network-service.c
+++ b/camel/camel-network-service.c
@@ -184,6 +184,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 edb1418..6395ca3 100644
--- a/camel/camel-offline-store.c
+++ b/camel/camel-offline-store.c
@@ -160,7 +160,8 @@ camel_offline_store_set_online_sync (CamelOfflineStore *store,
service = CAMEL_SERVICE (store);
session = camel_service_ref_session (service);
- network_available = camel_session_get_network_available (session);
+ network_available = camel_session_get_network_available (session) &&
+ camel_session_get_online (session);
store_is_online = camel_offline_store_get_online (store);
settings = camel_service_ref_settings (service);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]