summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2010-06-23 23:04:01 +0100
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-06-28 13:42:04 +0100
commit2658733763adbd9cf03d6f9a279c7b646cf975af (patch)
tree0f19576187a0c986e4d0de43e9ee56bf942bc58a
parentce772d81def90cef86f4e684fcd606e154c6027c (diff)
downloadevolution-data-server-2658733763adbd9cf03d6f9a279c7b646cf975af.tar.gz
Queue non-folder specific jobs while waiting for SELECT to complete
Remove this TODO from the list... (cherry picked from commit 2f2ba06d5bc8f799bc61d473963771ee58046384)
-rw-r--r--camel/providers/imapx/camel-imapx-server.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 14e6c7e1d..ed814f899 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -869,11 +869,32 @@ imapx_command_start_next(CamelIMAPXServer *is, CamelException *ex)
gint pri = -128;
c(printf("** Starting next command\n"));
- if (is->literal != NULL || is->select_pending != NULL) {
- c(if (is->select_pending)
- printf("* no, waiting for literal/pending select '%s'\n", is->select_pending->full_name));
+ if (is->literal) {
+ c(printf("* no; waiting for literal '%s'\n", is->literal->name));
+ return;
+ }
+
+ if (is->select_pending) {
+ c(printf("-- Checking job queue for non-folder jobs\n"));
+ ic = (CamelIMAPXCommand *)is->queue.head;
+ nc = ic->next;
+ while (nc && is->literal == NULL && count < MAX_COMMANDS && ic->pri >= pri) {
+ c(printf("-- %3d '%s'?\n", (gint)ic->pri, ic->name));
+ if (ic->select == NULL) {
+ c(printf("--> starting '%s'\n", ic->name));
+ pri = ic->pri;
+ camel_dlist_remove((CamelDListNode *)ic);
+ imapx_command_start(is, ic);
+ count++;
+ }
+ ic = nc;
+ nc = nc->next;
+ }
+
+ if (count)
+ return;
- /* TODO prolly start the store operations which do not require any folder to be selected */
+ c(printf("* no, waiting for pending select '%s'\n", camel_folder_get_full_name (is->select_pending)));
return;
}