aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-folder.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-05-15 01:53:47 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-05-15 01:53:47 +0800
commit0297c01437237045337130d80cfd9da6f0a270de (patch)
treeb74ff852b254342be26849a59f82926a334fb213 /camel/providers/imap/camel-imap-folder.c
parent34eb18b30bac238d4abf2664dfe9f1f28808db29 (diff)
downloadgsoc2013-evolution-0297c01437237045337130d80cfd9da6f0a270de.tar
gsoc2013-evolution-0297c01437237045337130d80cfd9da6f0a270de.tar.gz
gsoc2013-evolution-0297c01437237045337130d80cfd9da6f0a270de.tar.bz2
gsoc2013-evolution-0297c01437237045337130d80cfd9da6f0a270de.tar.lz
gsoc2013-evolution-0297c01437237045337130d80cfd9da6f0a270de.tar.xz
gsoc2013-evolution-0297c01437237045337130d80cfd9da6f0a270de.tar.zst
gsoc2013-evolution-0297c01437237045337130d80cfd9da6f0a270de.zip
Added a note to the comment block for this function noting that uids MUST
2003-05-13 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-utils.c (imap_uid_array_to_set): Added a note to the comment block for this function noting that uids MUST be in sorted order. * providers/imap/camel-imap-folder.c (imap_expunge_uids_online): Sort the uids before splitting them into UID set chunks. The code that splits the uid array into sets expects the uids to be in sorted order. Fixes bug #42854. * providers/imap/camel-imap-command.c (imap_command_start): Re-enable camel_verbose_debug logging. svn path=/trunk/; revision=21173
Diffstat (limited to 'camel/providers/imap/camel-imap-folder.c')
-rw-r--r--camel/providers/imap/camel-imap-folder.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 8a21c11451..16638d3902 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -847,6 +847,22 @@ imap_expunge_uids_offline (CamelFolder *folder, GPtrArray *uids, CamelException
camel_folder_change_info_free (changes);
}
+static int
+uid_compar (const void *va, const void *vb)
+{
+ const char **sa = (const char **)va, **sb = (const char **)vb;
+ unsigned long a, b;
+
+ a = strtoul (*sa, NULL, 10);
+ b = strtoul (*sb, NULL, 10);
+ if (a < b)
+ return -1;
+ else if (a == b)
+ return 0;
+ else
+ return 1;
+}
+
static void
imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *ex)
{
@@ -864,7 +880,9 @@ imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *
return;
}
}
-
+
+ qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
+
while (uid < uids->len) {
set = imap_uid_array_to_set (folder->summary, uids, uid, UID_SET_LIMIT, &uid);
response = camel_imap_command (store, folder, ex,
@@ -891,22 +909,6 @@ imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *
CAMEL_SERVICE_UNLOCK (store, connect_lock);
}
-static int
-uid_compar (const void *va, const void *vb)
-{
- const char **sa = (const char **)va, **sb = (const char **)vb;
- unsigned long a, b;
-
- a = strtoul (*sa, NULL, 10);
- b = strtoul (*sb, NULL, 10);
- if (a < b)
- return -1;
- else if (a == b)
- return 0;
- else
- return 1;
-}
-
static void
imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelException *ex)
{