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>
|
2003-05-22 Jeffrey Stedfast <fejj@ximian.com>
|
||||||
|
|
||||||
* camel-object.c (camel_object_bag_destroy): Lets try this
|
* 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);
|
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
|
static void
|
||||||
imap_expunge_uids_offline (CamelFolder *folder, GPtrArray *uids, CamelException *ex)
|
imap_expunge_uids_offline (CamelFolder *folder, GPtrArray *uids, CamelException *ex)
|
||||||
{
|
{
|
||||||
CamelFolderChangeInfo *changes;
|
CamelFolderChangeInfo *changes;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
|
||||||
|
|
||||||
changes = camel_folder_change_info_new ();
|
changes = camel_folder_change_info_new ();
|
||||||
|
|
||||||
for (i = 0; i < uids->len; i++) {
|
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);
|
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
|
static void
|
||||||
imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *ex)
|
imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *ex)
|
||||||
{
|
{
|
||||||
@ -1436,6 +1438,8 @@ imap_transfer_online (CamelFolder *source, GPtrArray *uids,
|
|||||||
|
|
||||||
count = camel_folder_summary_count (dest->summary);
|
count = camel_folder_summary_count (dest->summary);
|
||||||
|
|
||||||
|
qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
|
||||||
|
|
||||||
/* Now copy the messages */
|
/* Now copy the messages */
|
||||||
do_copy (source, uids, dest, ex);
|
do_copy (source, uids, dest, ex);
|
||||||
if (camel_exception_is_set (ex))
|
if (camel_exception_is_set (ex))
|
||||||
@ -1470,6 +1474,8 @@ imap_transfer_resyncing (CamelFolder *source, GPtrArray *uids,
|
|||||||
CamelMimeMessage *message;
|
CamelMimeMessage *message;
|
||||||
CamelMessageInfo *info;
|
CamelMessageInfo *info;
|
||||||
|
|
||||||
|
qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
|
||||||
|
|
||||||
/* This is trickier than append_resyncing, because some of
|
/* This is trickier than append_resyncing, because some of
|
||||||
* the messages we are copying may have been copied or
|
* the messages we are copying may have been copied or
|
||||||
* appended into @source while we were offline, in which case
|
* appended into @source while we were offline, in which case
|
||||||
@ -1566,6 +1572,8 @@ imap_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids
|
|||||||
/* NOTE: could get away without the search lock by creating a new
|
/* NOTE: could get away without the search lock by creating a new
|
||||||
search object each time */
|
search object each time */
|
||||||
|
|
||||||
|
qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
|
||||||
|
|
||||||
summary = g_ptr_array_new();
|
summary = g_ptr_array_new();
|
||||||
for (i=0;i<uids->len;i++) {
|
for (i=0;i<uids->len;i++) {
|
||||||
CamelMessageInfo *info;
|
CamelMessageInfo *info;
|
||||||
|
Reference in New Issue
Block a user