[evolution-data-server] CamelFolder: Update "host-reachable" before connecting.



commit 1f22c080d1d4b8ba1a62b50d82c4e545ff315767
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Nov 22 17:13:05 2013 -0500

    CamelFolder: Update "host-reachable" before connecting.

 camel/camel-folder.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index c2d86ac..58c14d8 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -36,6 +36,7 @@
 #include "camel-folder.h"
 #include "camel-mempool.h"
 #include "camel-mime-message.h"
+#include "camel-network-service.h"
 #include "camel-offline-store.h"
 #include "camel-operation.h"
 #include "camel-session.h"
@@ -516,7 +517,15 @@ folder_maybe_connect_sync (CamelFolder *folder,
        status = camel_service_get_connection_status (service);
        connect = (status != CAMEL_SERVICE_CONNECTED);
 
-       if (CAMEL_IS_OFFLINE_STORE (parent_store)) {
+       if (connect && CAMEL_IS_NETWORK_SERVICE (parent_store)) {
+               /* Disregard errors here.  Just want to
+                * know whether to attempt a connection. */
+               connect = camel_network_service_can_reach_sync (
+                       CAMEL_NETWORK_SERVICE (parent_store),
+                       cancellable, NULL);
+       }
+
+       if (connect && CAMEL_IS_OFFLINE_STORE (parent_store)) {
                CamelOfflineStore *offline_store;
 
                offline_store = CAMEL_OFFLINE_STORE (parent_store);


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