summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-10-03 00:15:23 +0000
committerMichael Zucci <zucchi@src.gnome.org>2002-10-03 00:15:23 +0000
commit9c53978cd08c323e4a515c3cdf0ba8dd2a1c9050 (patch)
tree57f63485366c05cdc20c08666771af7837c6ba1d
parent155afbf5514e6bf9430495411b6b4eb124cf6baf (diff)
downloadevolution-data-server-9c53978cd08c323e4a515c3cdf0ba8dd2a1c9050.tar.gz
/home/notzed/gnome/head/evolution/camel
2002-10-02 Not Zed <NotZed@Ximian.com> * providers/imap/camel-imap-folder.c (get_matching): Set *set to NULL if we dont get any matches. (imap_sync_online): If we get no matches, skip any work, also reorder some code to make it easier to skip. See #31031. * providers/imap/camel-imap-store.c (imap_check_folder_still_extant): Default to "TRUE", if the list command failed, it probably means a server problem, assume the worst. This makes imap_refresh_info not clear the exception and crash. Fixes crash of #31000. 2002-10-01 Not Zed <NotZed@Ximian.com> * providers/imap/camel-imap-folder.c (imap_refresh_info): Make sure we pass the exception to imap_folder_selected(), otherwise failures can be lost. See bug #31000. 2002-10-01 Not Zed <NotZed@Ximian.com> * camel-folder.c (thaw): Add an assertion that the frozen count>0. (freeze): Same for >= 0. * camel-vee-folder.c (camel_vee_folder_remove_folder): Use the unmatched freeze_count when thawing folders removed from unmatched, rather than the folder's freeze_count. Might be related to #27391.
-rw-r--r--camel/ChangeLog29
-rw-r--r--camel/camel-folder.c4
-rw-r--r--camel/camel-vee-folder.c4
-rw-r--r--camel/providers/imap/camel-imap-folder.c15
-rw-r--r--camel/providers/imap/camel-imap-store.c19
5 files changed, 49 insertions, 22 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index c11375dcf..053e72158 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,32 @@
+2002-10-02 Not Zed <NotZed@Ximian.com>
+
+ * providers/imap/camel-imap-folder.c (get_matching): Set *set to
+ NULL if we dont get any matches.
+ (imap_sync_online): If we get no matches, skip any work, also
+ reorder some code to make it easier to skip. See #31031.
+
+ * providers/imap/camel-imap-store.c
+ (imap_check_folder_still_extant): Default to "TRUE", if the list
+ command failed, it probably means a server problem, assume the
+ worst. This makes imap_refresh_info not clear the exception and
+ crash. Fixes crash of #31000.
+
+2002-10-01 Not Zed <NotZed@Ximian.com>
+
+ * providers/imap/camel-imap-folder.c (imap_refresh_info): Make
+ sure we pass the exception to imap_folder_selected(), otherwise
+ failures can be lost. See bug #31000.
+
+2002-10-01 Not Zed <NotZed@Ximian.com>
+
+ * camel-folder.c (thaw): Add an assertion that the frozen count>0.
+ (freeze): Same for >= 0.
+
+ * camel-vee-folder.c (camel_vee_folder_remove_folder): Use the
+ unmatched freeze_count when thawing folders removed from
+ unmatched, rather than the folder's freeze_count. Might be
+ related to #27391.
+
2002-10-01 Jeffrey Stedfast <fejj@ximian.com>
* providers/imap/camel-imap-folder.c (decode_internaldate): Use
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 494191559..a374e1a8d 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -1458,6 +1458,8 @@ freeze (CamelFolder *folder)
{
CAMEL_FOLDER_LOCK(folder, change_lock);
+ g_assert(folder->priv->frozen >= 0);
+
folder->priv->frozen++;
d(printf ("freeze(%p '%s') = %d\n", folder, folder->full_name, folder->priv->frozen));
@@ -1488,6 +1490,8 @@ thaw (CamelFolder * folder)
CAMEL_FOLDER_LOCK(folder, change_lock);
+ g_assert(folder->priv->frozen > 0);
+
folder->priv->frozen--;
d(printf ("thaw(%p '%s') = %d\n", folder, folder->full_name, folder->priv->frozen));
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index a2d384174..82f9c7feb 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -426,7 +426,7 @@ camel_vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
camel_object_unref((CamelObject *)sub);
/* undo the freeze state that Unmatched has imposed on this source folder */
- for (i = 0; i < p->freeze_count; i++)
+ for (i = 0; i < up->freeze_count; i++)
camel_folder_thaw (sub);
}
} else if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) {
@@ -435,7 +435,7 @@ camel_vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
camel_object_unref((CamelObject *)sub);
/* undo the freeze state that Unmatched has imposed on this source folder */
- for (i = 0; i < p->freeze_count; i++)
+ for (i = 0; i < up->freeze_count; i++)
camel_folder_thaw (sub);
}
if (g_list_find(up->folders, sub) == NULL) {
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index fda670169..0dec15750 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -488,7 +488,7 @@ imap_refresh_info (CamelFolder *folder, CamelException *ex)
CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
response = camel_imap_command (imap_store, folder, ex, NULL);
if (response) {
- camel_imap_folder_selected (folder, response, NULL);
+ camel_imap_folder_selected (folder, response, ex);
camel_imap_response_free (imap_store, response);
}
return;
@@ -715,6 +715,7 @@ get_matching (CamelFolder *folder, guint32 flags, guint32 mask, char **set)
g_string_free (gset, FALSE);
return matches;
} else {
+ *set = NULL
g_string_free (gset, TRUE);
g_ptr_array_free (matches, TRUE);
return NULL;
@@ -760,11 +761,7 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
empty-set of flags so... if this is true then we
want to unset the previously set flags.*/
unset = !(info->flags & CAMEL_IMAP_SERVER_FLAGS);
-
- /* FIXME: since we don't know the previously set flags,
- if unset is TRUE then just unset all the flags? */
- flaglist = imap_create_flag_list (unset ? CAMEL_IMAP_SERVER_FLAGS : info->flags);
-
+
/* Note: get_matching() uses UID_SET_LIMIT to limit
the size of the uid-set string. We don't have to
loop here to flush all the matching uids because
@@ -773,7 +770,13 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
matches = get_matching (folder, info->flags & (CAMEL_IMAP_SERVER_FLAGS | CAMEL_MESSAGE_FOLDER_FLAGGED),
CAMEL_IMAP_SERVER_FLAGS | CAMEL_MESSAGE_FOLDER_FLAGGED, &set);
camel_folder_summary_info_free (folder->summary, info);
+ if (matches == NULL)
+ continue;
+ /* FIXME: since we don't know the previously set flags,
+ if unset is TRUE then just unset all the flags? */
+ flaglist = imap_create_flag_list (unset ? CAMEL_IMAP_SERVER_FLAGS : info->flags);
+
/* Note: to `unset' flags, use -FLAGS.SILENT (<flag list>) */
response = camel_imap_command (store, folder, &local_ex,
"UID STORE %s %sFLAGS.SILENT %s",
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index fe0a04f8d..1da03ffde 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -944,24 +944,16 @@ imap_check_folder_still_extant (CamelImapStore *imap_store, const char *full_nam
full_name);
if (response) {
- gboolean stillthere = FALSE;
-
- if (response->untagged->len)
- stillthere = TRUE;
+ gboolean stillthere = response->untagged->len != 0;
camel_imap_response_free_without_processing (imap_store, response);
- if (stillthere)
- return TRUE;
+ return stillthere;
}
- /* either LIST command was rejected or it gave no results,
- * we can be sure that the folder is gone. */
-
- camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
- _("The folder %s no longer exists"),
- full_name);
- return FALSE;
+ /* if the command was rejected, there must be some other error,
+ assume it worked so we dont blow away the folder unecessarily */
+ return TRUE;
}
static void
@@ -1008,7 +1000,6 @@ imap_store_refresh_folders (CamelImapStore *store, CamelException *ex)
camel_object_unref((CamelObject *)folder);
imap_folder_effectively_unsubscribed (store, namedup, ex);
imap_forget_folder (store, namedup, ex);
- camel_exception_clear (ex);
g_free (namedup);
} else
camel_object_unref((CamelObject *)folder);