This should finish fixing all variations of bug #42854, which, funnily
2003-05-27 Jeffrey Stedfast <fejj@ximian.com> This should finish fixing all variations of bug #42854, which, funnily enough specified "copying" as the scenario for reproducing this bug, but somehow I found/fixed it only for expunging for some reason? I can't even guess as to how this happened. Oh well, expunging needed fixing either way. * providers/imap/camel-imap-folder.c (imap_transfer_online): Sort the uids here too (just like I had fixed for expunge a week or so ago). (imap_transfer_resyncing): Sort them here too. (imap_search_by_uids): Sort here too, even though I don't think it is necessary. Can't hurt. (imap_expunge_uids_offline): Might as well sort here too. svn path=/trunk/; revision=21341
This commit is contained in:

committed by
Jeffrey Stedfast

parent
d575bb994e
commit
de9458db31
@ -1,3 +1,19 @@
|
||||
2003-05-27 Jeffrey Stedfast <fejj@ximian.com>
|
||||
|
||||
This should finish fixing all variations of bug #42854, which,
|
||||
funnily enough specified "copying" as the scenario for reproducing
|
||||
this bug, but somehow I found/fixed it only for expunging for some
|
||||
reason? I can't even guess as to how this happened. Oh well,
|
||||
expunging needed fixing either way.
|
||||
|
||||
* providers/imap/camel-imap-folder.c (imap_transfer_online): Sort
|
||||
the uids here too (just like I had fixed for expunge a week or so
|
||||
ago).
|
||||
(imap_transfer_resyncing): Sort them here too.
|
||||
(imap_search_by_uids): Sort here too, even though I don't think it
|
||||
is necessary. Can't hurt.
|
||||
(imap_expunge_uids_offline): Might as well sort here too.
|
||||
|
||||
2003-05-22 Jeffrey Stedfast <fejj@ximian.com>
|
||||
|
||||
* camel-object.c (camel_object_bag_destroy): Lets try this
|
||||
|
@ -823,12 +823,30 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
|
||||
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_offline (CamelFolder *folder, GPtrArray *uids, CamelException *ex)
|
||||
{
|
||||
CamelFolderChangeInfo *changes;
|
||||
int i;
|
||||
|
||||
|
||||
qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
|
||||
|
||||
changes = camel_folder_change_info_new ();
|
||||
|
||||
for (i = 0; i < uids->len; i++) {
|
||||
@ -847,22 +865,6 @@ 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)
|
||||
{
|
||||
@ -1435,7 +1437,9 @@ imap_transfer_online (CamelFolder *source, GPtrArray *uids,
|
||||
return;
|
||||
|
||||
count = camel_folder_summary_count (dest->summary);
|
||||
|
||||
|
||||
qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
|
||||
|
||||
/* Now copy the messages */
|
||||
do_copy (source, uids, dest, ex);
|
||||
if (camel_exception_is_set (ex))
|
||||
@ -1469,7 +1473,9 @@ imap_transfer_resyncing (CamelFolder *source, GPtrArray *uids,
|
||||
const char *uid;
|
||||
CamelMimeMessage *message;
|
||||
CamelMessageInfo *info;
|
||||
|
||||
|
||||
qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
|
||||
|
||||
/* This is trickier than append_resyncing, because some of
|
||||
* the messages we are copying may have been copied or
|
||||
* appended into @source while we were offline, in which case
|
||||
@ -1565,7 +1571,9 @@ imap_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids
|
||||
|
||||
/* NOTE: could get away without the search lock by creating a new
|
||||
search object each time */
|
||||
|
||||
|
||||
qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
|
||||
|
||||
summary = g_ptr_array_new();
|
||||
for (i=0;i<uids->len;i++) {
|
||||
CamelMessageInfo *info;
|
||||
|
Reference in New Issue
Block a user