dovecot: If post-APPEND syncing sent a lot of data, connection c...

dovecot at dovecot.org dovecot at dovecot.org
Sat Dec 22 01:19:15 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/b83be2b6ac8f
changeset: 7018:b83be2b6ac8f
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Dec 22 01:19:11 2007 +0200
description:
If post-APPEND syncing sent a lot of data, connection could have hanged.

diffstat:

1 file changed, 7 insertions(+), 2 deletions(-)
src/imap/cmd-append.c |    9 +++++++--

diffs (28 lines):

diff -r 80d3b8fcec09 -r b83be2b6ac8f src/imap/cmd-append.c
--- a/src/imap/cmd-append.c	Sat Dec 22 00:21:09 2007 +0200
+++ b/src/imap/cmd-append.c	Sat Dec 22 01:19:11 2007 +0200
@@ -39,6 +39,7 @@ static void client_input_append(struct c
 {
 	struct cmd_append_context *ctx = cmd->context;
 	struct client *client = cmd->client;
+	bool finished;
 
 	i_assert(!client->destroyed);
 
@@ -73,10 +74,14 @@ static void client_input_append(struct c
 	}
 
 	o_stream_cork(client->output);
-	if (cmd->func(cmd)) {
-		o_stream_uncork(client->output);
+	finished = cmd->func(cmd);
+	o_stream_uncork(client->output);
+	if (finished) {
 		client_command_free(cmd);
 		client_continue_pending_input(&client);
+	} else if (cmd->output_pending) {
+		/* syncing didn't send everything */
+		o_stream_set_flush_pending(client->output, TRUE);
 	}
 }
 


More information about the dovecot-cvs mailing list