|
|
9cfe9a |
diff -up evolution-data-server-3.8.5/camel/camel-imapx-store.c.imapx-connect-store evolution-data-server-3.8.5/camel/camel-imapx-store.c
|
|
|
9cfe9a |
--- evolution-data-server-3.8.5/camel/camel-imapx-store.c.imapx-connect-store 2013-10-14 17:15:00.129077116 +0200
|
|
|
9cfe9a |
+++ evolution-data-server-3.8.5/camel/camel-imapx-store.c 2013-10-14 17:16:40.005070287 +0200
|
|
|
9cfe9a |
@@ -1461,12 +1461,6 @@ imapx_store_get_folder_info_sync (CamelS
|
|
|
9cfe9a |
return fi;
|
|
|
9cfe9a |
}
|
|
|
9cfe9a |
|
|
|
9cfe9a |
- if (!camel_service_connect_sync (
|
|
|
9cfe9a |
- CAMEL_SERVICE (store), cancellable, error)) {
|
|
|
9cfe9a |
- g_mutex_unlock (&istore->get_finfo_lock);
|
|
|
9cfe9a |
- return NULL;
|
|
|
9cfe9a |
- }
|
|
|
9cfe9a |
-
|
|
|
9cfe9a |
if (*top && flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIPTION_LIST) {
|
|
|
9cfe9a |
fi = get_folder_info_offline (store, top, flags, error);
|
|
|
9cfe9a |
g_mutex_unlock (&istore->get_finfo_lock);
|
|
|
9cfe9a |
diff -up evolution-data-server-3.8.5/camel/camel-store.c.imapx-connect-store evolution-data-server-3.8.5/camel/camel-store.c
|
|
|
9cfe9a |
--- evolution-data-server-3.8.5/camel/camel-store.c.imapx-connect-store 2013-07-23 13:57:42.000000000 +0200
|
|
|
9cfe9a |
+++ evolution-data-server-3.8.5/camel/camel-store.c 2013-10-14 17:17:46.438065744 +0200
|
|
|
9cfe9a |
@@ -38,6 +38,7 @@
|
|
|
9cfe9a |
#include "camel-debug.h"
|
|
|
9cfe9a |
#include "camel-folder.h"
|
|
|
9cfe9a |
#include "camel-marshal.h"
|
|
|
9cfe9a |
+#include "camel-offline-store.h"
|
|
|
9cfe9a |
#include "camel-session.h"
|
|
|
9cfe9a |
#include "camel-store.h"
|
|
|
9cfe9a |
#include "camel-store-settings.h"
|
|
|
9cfe9a |
@@ -276,6 +277,39 @@ store_get_special (CamelStore *store,
|
|
|
9cfe9a |
return folder;
|
|
|
9cfe9a |
}
|
|
|
9cfe9a |
|
|
|
9cfe9a |
+static gboolean
|
|
|
9cfe9a |
+store_maybe_connect_sync (CamelStore *store,
|
|
|
9cfe9a |
+ GCancellable *cancellable,
|
|
|
9cfe9a |
+ GError **error)
|
|
|
9cfe9a |
+{
|
|
|
9cfe9a |
+ CamelService *service;
|
|
|
9cfe9a |
+ CamelServiceConnectionStatus status;
|
|
|
9cfe9a |
+ gboolean connect = FALSE;
|
|
|
9cfe9a |
+ gboolean success = TRUE;
|
|
|
9cfe9a |
+
|
|
|
9cfe9a |
+ /* This is meant to recover from dropped connections
|
|
|
9cfe9a |
+ * when the CamelService is online but disconnected. */
|
|
|
9cfe9a |
+
|
|
|
9cfe9a |
+ service = CAMEL_SERVICE (store);
|
|
|
9cfe9a |
+ status = camel_service_get_connection_status (service);
|
|
|
9cfe9a |
+ connect = (status != CAMEL_SERVICE_CONNECTED);
|
|
|
9cfe9a |
+
|
|
|
9cfe9a |
+ if (CAMEL_IS_OFFLINE_STORE (store)) {
|
|
|
9cfe9a |
+ CamelOfflineStore *offline_store;
|
|
|
9cfe9a |
+
|
|
|
9cfe9a |
+ offline_store = CAMEL_OFFLINE_STORE (store);
|
|
|
9cfe9a |
+ if (!camel_offline_store_get_online (offline_store))
|
|
|
9cfe9a |
+ connect = FALSE;
|
|
|
9cfe9a |
+ }
|
|
|
9cfe9a |
+
|
|
|
9cfe9a |
+ if (connect) {
|
|
|
9cfe9a |
+ success = camel_service_connect_sync (
|
|
|
9cfe9a |
+ service, cancellable, error);
|
|
|
9cfe9a |
+ }
|
|
|
9cfe9a |
+
|
|
|
9cfe9a |
+ return success;
|
|
|
9cfe9a |
+}
|
|
|
9cfe9a |
+
|
|
|
9cfe9a |
static void
|
|
|
9cfe9a |
store_finalize (GObject *object)
|
|
|
9cfe9a |
{
|
|
|
9cfe9a |
@@ -2099,6 +2133,12 @@ camel_store_get_folder_info_sync (CamelS
|
|
|
9cfe9a |
cancellable, _("Scanning folders in '%s'"), name);
|
|
|
9cfe9a |
g_free (name);
|
|
|
9cfe9a |
|
|
|
9cfe9a |
+ /* Recover from a dropped connection, unless we're offline. */
|
|
|
9cfe9a |
+ if (!store_maybe_connect_sync (store, cancellable, error)) {
|
|
|
9cfe9a |
+ camel_operation_pop_message (cancellable);
|
|
|
9cfe9a |
+ return NULL;
|
|
|
9cfe9a |
+ }
|
|
|
9cfe9a |
+
|
|
|
9cfe9a |
info = class->get_folder_info_sync (
|
|
|
9cfe9a |
store, top, flags, cancellable, error);
|
|
|
9cfe9a |
if (!(flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED))
|
|
|
9cfe9a |
diff -up evolution-data-server-3.8.5/camel/providers/nntp/camel-nntp-store.c.imapx-connect-store evolution-data-server-3.8.5/camel/providers/nntp/camel-nntp-store.c
|
|
|
9cfe9a |
--- evolution-data-server-3.8.5/camel/providers/nntp/camel-nntp-store.c.imapx-connect-store 2013-08-03 09:57:21.000000000 +0200
|
|
|
9cfe9a |
+++ evolution-data-server-3.8.5/camel/providers/nntp/camel-nntp-store.c 2013-10-14 17:15:00.131077116 +0200
|
|
|
9cfe9a |
@@ -1292,17 +1292,8 @@ nntp_get_folder_info_online (CamelStore
|
|
|
9cfe9a |
GCancellable *cancellable,
|
|
|
9cfe9a |
GError **error)
|
|
|
9cfe9a |
{
|
|
|
9cfe9a |
- CamelService *service;
|
|
|
9cfe9a |
- CamelFolderInfo *info = NULL;
|
|
|
9cfe9a |
-
|
|
|
9cfe9a |
- service = CAMEL_SERVICE (store);
|
|
|
9cfe9a |
-
|
|
|
9cfe9a |
- /* Reconnect if necessary. */
|
|
|
9cfe9a |
- if (camel_service_connect_sync (service, cancellable, error))
|
|
|
9cfe9a |
- info = nntp_get_folder_info (
|
|
|
9cfe9a |
- store, top, flags, TRUE, cancellable, error);
|
|
|
9cfe9a |
-
|
|
|
9cfe9a |
- return info;
|
|
|
9cfe9a |
+ return nntp_get_folder_info (
|
|
|
9cfe9a |
+ store, top, flags, TRUE, cancellable, error);
|
|
|
9cfe9a |
}
|
|
|
9cfe9a |
|
|
|
9cfe9a |
static CamelFolderInfo *
|