From ca56f39c8f41075870dde30e446349d7155854c1 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 24 Aug 2004 14:02:22 +0000 Subject: Check for an exception from get_folders_online() here so that we don't 2004-08-23 Jeffrey Stedfast * providers/imap/camel-imap-store.c (get_folders): Check for an exception from get_folders_online() here so that we don't send commands to an IMAP server after a disconnect for example. See bug #63504 for an example. svn path=/trunk/; revision=27005 --- camel/ChangeLog | 7 +++++++ camel/providers/imap/camel-imap-store.c | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index 1677cfbb20..fd009e2f4f 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -7,6 +7,13 @@ element. (imap_is_subfolder): helper for above. +2004-08-23 Jeffrey Stedfast + + * providers/imap/camel-imap-store.c (get_folders): Check for an + exception from get_folders_online() here so that we don't send + commands to an IMAP server after a disconnect for example. See bug + #63504 for an example. + 2004-08-23 Jeffrey Stedfast * camel-tcp-stream-openssl.c (open_ssl_connection): Call diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index 4ba85ef39b..af031bdc47 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -2814,7 +2814,7 @@ static GPtrArray * get_folders(CamelStore *store, const char *top, guint32 flags, CamelException *ex) { CamelImapStore *imap_store = CAMEL_IMAP_STORE (store); - GSList *p = NULL; + GSList *q, *p = NULL; GHashTable *infos; int i; GPtrArray *folders, *folders_out; @@ -2885,7 +2885,7 @@ get_folders(CamelStore *store, const char *top, guint32 flags, CamelException *e /* p is a reversed list of pending folders for the next level, q is the list of folders for this */ while (p) { - GSList *q = g_slist_reverse(p); + q = g_slist_reverse(p); p = NULL; while (q) { @@ -2913,7 +2913,10 @@ get_folders(CamelStore *store, const char *top, guint32 flags, CamelException *e get_folders_online(imap_store, n, folders, flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED, ex); g_free(n); g_free(real); - + + if (camel_exception_is_set (ex)) + goto fail; + if (folders->len > 0) fi->flags |= CAMEL_FOLDER_CHILDREN; @@ -2933,6 +2936,7 @@ fail: g_ptr_array_free(folders, TRUE); g_ptr_array_free(folders_out, TRUE); g_hash_table_destroy(infos); + g_slist_free (p); g_free(name); return NULL; -- cgit v1.2.3