[evolution-data-server] Queue non-folder specific jobs while waiting for SELECT to complete



commit 2f2ba06d5bc8f799bc61d473963771ee58046384
Author: David Woodhouse <David Woodhouse intel com>
Date:   Wed Jun 23 23:04:01 2010 +0100

    Queue non-folder specific jobs while waiting for SELECT to complete
    
    Remove this TODO from the list...

 camel/providers/imapx/camel-imapx-server.c |   29 ++++++++++++++++++++++++---
 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 c861190..92c8e5b 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -858,11 +858,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", camel_folder_get_full_name (is->select_pending)));
+	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;
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]