From b1e66c4c60ca6d52c0a164a510e5199ca201bf98 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Tue, 5 Sep 2000 20:08:10 +0000 Subject: Cleanup of lots of exception handling ; bugfixes svn path=/trunk/; revision=5202 --- camel/providers/imap/camel-imap-folder.c | 10 ++++++++++ camel/providers/imap/camel-imap-store.c | 14 ++++++++++---- camel/providers/imap/camel-imap-store.h | 3 --- 3 files changed, 20 insertions(+), 7 deletions(-) (limited to 'camel/providers/imap') diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index c4c26db300..5b55f6bf9a 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -191,11 +191,21 @@ camel_imap_folder_new (CamelStore *parent, char *folder_name, CamelException *ex CF_CLASS (folder)->init (folder, parent, NULL, folder_name, dir_sep, FALSE, ex); + if (camel_exception_is_set (ex)) { + camel_object_unref (CAMEL_OBJECT (folder)); + return NULL; + } + if (!strcmp (folder_name, url->path + 1)) folder->can_hold_messages = FALSE; CF_CLASS (folder)->refresh_info (folder, ex); + if (camel_exception_is_set (ex)) { + camel_object_unref (CAMEL_OBJECT (folder)); + return NULL; + } + return folder; } diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index 820c2453ce..5ffdd51d4b 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -95,7 +95,8 @@ camel_imap_store_init (gpointer object, gpointer klass) service->url_flags |= (CAMEL_SERVICE_URL_NEED_USER | CAMEL_SERVICE_URL_NEED_HOST | - CAMEL_SERVICE_URL_ALLOW_PATH); + CAMEL_SERVICE_URL_ALLOW_PATH | + CAMEL_SERVICE_URL_ALLOW_AUTH); imap_store->dir_sep = g_strdup ("/"); /*default*/ imap_store->current_folder = NULL; @@ -231,6 +232,7 @@ imap_connect (CamelService *service, CamelException *ex) errbuf = g_strdup_printf ("Unable to authenticate to IMAP server.\n" "%s\n\n", camel_exception_get_description (ex)); + camel_exception_clear (ex); } else { g_message ("IMAP Service sucessfully authenticated user %s", service->url->user); authenticated = TRUE; @@ -280,8 +282,10 @@ imap_connect (CamelService *service, CamelException *ex) } g_free (result); - - return TRUE; + + camel_remote_store_refresh_folders (CAMEL_REMOTE_STORE (store), ex); + + return ! camel_exception_is_set (ex); } static gboolean @@ -336,7 +340,6 @@ imap_folder_exists (CamelFolder *folder, CamelException *ex) &result, ex, "EXAMINE %s", folder_path); if (status != CAMEL_IMAP_OK) { - g_free (result); g_free (folder_path); return FALSE; } @@ -439,6 +442,9 @@ get_folder (CamelStore *store, const char *folder_name, gboolean create, CamelEx new_folder = camel_imap_folder_new (store, folder_path, ex); + if (camel_exception_is_set (ex)) + return NULL; + /* this is the top-level dir, we already know it exists - it has to! */ if (!strcmp (folder_name, dir_sep)) return new_folder; diff --git a/camel/providers/imap/camel-imap-store.h b/camel/providers/imap/camel-imap-store.h index 7aa911f394..2b946f065c 100644 --- a/camel/providers/imap/camel-imap-store.h +++ b/camel/providers/imap/camel-imap-store.h @@ -50,7 +50,6 @@ typedef struct { CamelRemoteStore parent_object; CamelFolder *current_folder; - CamelStream *istream, *ostream; guint32 command; @@ -58,8 +57,6 @@ typedef struct { gboolean has_status_capability; gchar *dir_sep; - - guint timeout_id; } CamelImapStore; -- cgit v1.2.3