[dovecot-cvs] dovecot/src/imap client.c, 1.43, 1.44 cmd-append.c, 1.44, 1.45 cmd-idle.c, 1.15, 1.16

cras at dovecot.org cras at dovecot.org
Sat Aug 28 12:32:33 EEST 2004


Update of /home/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv20481

Modified Files:
	client.c cmd-append.c cmd-idle.c 
Log Message:
Deinitialize command handlers always.



Index: client.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/client.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- client.c	22 Aug 2004 12:02:48 -0000	1.43
+++ client.c	28 Aug 2004 09:32:30 -0000	1.44
@@ -58,6 +58,13 @@
 
 void client_destroy(struct client *client)
 {
+	if (client->cmd_func != NULL) {
+		/* try to deinitialize the command */
+		i_stream_close(client->input);
+		o_stream_close(client->output);
+		(void)client->cmd_func(client);
+	}
+
 	if (client->mailbox != NULL)
 		mailbox_close(client->mailbox);
 	namespace_deinit(client->namespaces);

Index: cmd-append.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/cmd-append.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- cmd-append.c	22 Aug 2004 11:48:55 -0000	1.44
+++ cmd-append.c	28 Aug 2004 09:32:30 -0000	1.45
@@ -231,7 +231,8 @@
 	int failed;
 
 	if (ctx->save_ctx != NULL) {
-		if (mailbox_save_continue(ctx->save_ctx) < 0) {
+		if (mailbox_save_continue(ctx->save_ctx) < 0 ||
+		    client->input->closed) {
 			/* we still have to finish reading the message
 			   from client */
 			mailbox_save_cancel(ctx->save_ctx);

Index: cmd-idle.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/cmd-idle.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- cmd-idle.c	23 Aug 2004 07:14:06 -0000	1.15
+++ cmd-idle.c	28 Aug 2004 09:32:30 -0000	1.16
@@ -134,6 +134,11 @@
 {
 	struct cmd_idle_context *ctx = client->cmd_context;
 
+	if (client->output->closed) {
+		idle_finish(ctx, FALSE);
+		return TRUE;
+	}
+
 	if (ctx->sync_ctx != NULL) {
 		if (imap_sync_more(ctx->sync_ctx) == 0) {
 			/* unfinished */
@@ -156,6 +161,7 @@
 		   client */
                 idle_callback(client->mailbox, client);
 	}
+
 	return FALSE;
 }
 



More information about the dovecot-cvs mailing list