[dovecot-cvs] dovecot/src/imap client.c, 1.57, 1.58 cmd-append.c, 1.66, 1.67 cmd-idle.c, 1.20, 1.21

cras at dovecot.org cras at dovecot.org
Sun Dec 25 12:51:28 EET 2005


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

Modified Files:
	client.c cmd-append.c cmd-idle.c 
Log Message:
IDLE: Sending "DONE" + next command in same TCP packet caused the next command not to be executed until yet another command came (which usually didn't happen).



Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/client.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- client.c	24 Sep 2005 09:47:58 -0000	1.57
+++ client.c	25 Dec 2005 10:51:25 -0000	1.58
@@ -239,6 +239,7 @@
 void _client_reset_command(struct client *client)
 {
 	pool_t pool;
+	size_t size;
 
 	/* reset input idle time because command output might have taken a
 	   long time and we don't want to disconnect client immediately then */
@@ -258,6 +259,13 @@
 	client->cmd.client = client;
 
 	imap_parser_reset(client->parser);
+
+	/* if there's unread data in buffer, remember that there's input
+	   pending and we should get around to calling client_input() soon.
+	   This is mostly for APPEND/IDLE. */
+	(void)i_stream_get_data(client->input, &size);
+	if (size > 0)
+		client->input_pending = TRUE;
 }
 
 /* Skip incoming data until newline is found,

Index: cmd-append.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-append.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- cmd-append.c	24 Sep 2005 09:48:19 -0000	1.66
+++ cmd-append.c	25 Dec 2005 10:51:25 -0000	1.67
@@ -105,8 +105,6 @@
 
 static void cmd_append_finish(struct cmd_append_context *ctx)
 {
-	size_t size;
-
 	ctx->client->input_skip_line = TRUE;
 
 	io_remove(ctx->client->io);
@@ -125,9 +123,6 @@
 
 	if (ctx->box != ctx->cmd->client->mailbox && ctx->box != NULL)
 		mailbox_close(ctx->box);
-
-	(void)i_stream_get_data(ctx->client->input, &size);
-	ctx->client->input_pending = size != 0;
 }
 
 static int cmd_append_continue_cancel(struct client_command_context *cmd)

Index: cmd-idle.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-idle.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- cmd-idle.c	6 Dec 2005 14:32:50 -0000	1.20
+++ cmd-idle.c	25 Dec 2005 10:51:25 -0000	1.21
@@ -62,6 +62,9 @@
 
 	client->bad_counter = 0;
 	_client_reset_command(client);
+
+	if (client->input_pending)
+		_client_input(client);
 }
 
 static void idle_client_input(void *context)



More information about the dovecot-cvs mailing list