changeset 3942:a490e6657329 HEAD

If there had been enough sync changes while APPEND was being done, we never reset flush callback to _client_output, which could have caused hangs later.
author Timo Sirainen <tss@iki.fi>
date Thu, 26 Jan 2006 23:08:53 +0200
parents 08a302d3e525
children cbe5c6772e0d
files src/imap/cmd-append.c
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/cmd-append.c	Thu Jan 26 22:42:49 2006 +0200
+++ b/src/imap/cmd-append.c	Thu Jan 26 23:08:53 2006 +0200
@@ -58,10 +58,10 @@
 	}
 
 	if (cmd->func(cmd)) {
-		/* command execution was finished */
-		client->bad_counter = 0;
-		_client_reset_command(client);
-
+		/* command execution was finished. Note that if cmd_sync()
+		   didn't finish, we didn't get here but the input handler
+		   has already been moved. So don't do anything important
+		   here.. */
 		if (client->input_pending)
 			_client_input(client);
 	}
@@ -120,6 +120,9 @@
 
 	if (ctx->box != ctx->cmd->client->mailbox && ctx->box != NULL)
 		mailbox_close(&ctx->box);
+
+	ctx->client->bad_counter = 0;
+	_client_reset_command(ctx->client);
 }
 
 static bool cmd_append_continue_cancel(struct client_command_context *cmd)