[dovecot-cvs] dovecot/src/imap client.c, 1.48, 1.49 client.h, 1.24, 1.25 cmd-idle.c, 1.16, 1.17

cras at dovecot.org cras at dovecot.org
Thu Oct 21 05:36:31 EEST 2004


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv22140

Modified Files:
	client.c client.h cmd-idle.c 
Log Message:
IDLE used 100% CPU.



Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/client.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- client.c	20 Oct 2004 17:07:32 -0000	1.48
+++ client.c	21 Oct 2004 02:36:29 -0000	1.49
@@ -392,9 +392,15 @@
 
 	/* continue processing command */
 	o_stream_cork(client->output);
+	client->output_pending = TRUE;
 	finished = client->cmd_func(client) || client->cmd_param_error;
 	o_stream_uncork(client->output);
 
+	/* a bit kludgy. normally we would want to get back here, but IDLE
+	   is a special case which has command pending but without necessarily
+	   anything to write. */
+	ret = finished || !client->output_pending;
+
 	if (finished) {
 		/* command execution was finished */
 		client->bad_counter = 0;
@@ -403,7 +409,7 @@
 		if (client->input_pending)
 			_client_input(client);
 	}
-	return finished;
+	return ret;
 }
 
 static void idle_timeout(void *context __attr_unused__)

Index: client.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/client.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- client.h	28 Aug 2004 12:57:05 -0000	1.24
+++ client.h	21 Oct 2004 02:36:29 -0000	1.25
@@ -39,6 +39,7 @@
 
 	unsigned int command_pending:1;
 	unsigned int input_pending:1;
+	unsigned int output_pending:1;
 	unsigned int cmd_uid:1; /* used UID command */
 	unsigned int cmd_param_error:1;
 	unsigned int rawlog:1;

Index: cmd-idle.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-idle.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- cmd-idle.c	28 Aug 2004 09:32:30 -0000	1.16
+++ cmd-idle.c	21 Oct 2004 02:36:29 -0000	1.17
@@ -162,6 +162,7 @@
                 idle_callback(client->mailbox, client);
 	}
 
+        client->output_pending = FALSE;
 	return FALSE;
 }
 



More information about the dovecot-cvs mailing list