dovecot-2.0: imap, pop3: Cork TCP connection before trying to fl...

dovecot at dovecot.org dovecot at dovecot.org
Thu Oct 14 18:59:00 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/f3aa8be626fa
changeset: 12265:f3aa8be626fa
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Oct 14 16:58:57 2010 +0100
description:
imap, pop3: Cork TCP connection before trying to flush output in output callback.

diffstat:

 src/imap/imap-client.c |  2 +-
 src/pop3/pop3-client.c |  7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diffs (51 lines):

diff -r a3e40c6b14fe -r f3aa8be626fa src/imap/imap-client.c
--- a/src/imap/imap-client.c	Thu Oct 14 16:53:04 2010 +0100
+++ b/src/imap/imap-client.c	Thu Oct 14 16:58:57 2010 +0100
@@ -847,6 +847,7 @@
 	if (client->to_idle_output != NULL)
 		timeout_reset(client->to_idle_output);
 
+	o_stream_cork(client->output);
 	if ((ret = o_stream_flush(client->output)) < 0) {
 		client_destroy(client, NULL);
 		return 1;
@@ -856,7 +857,6 @@
 	for (cmd = client->command_queue; cmd != NULL; cmd = cmd->next)
 		cmd->temp_executed = FALSE;
 
-	o_stream_cork(client->output);
 	if (client->output_lock != NULL) {
 		client->output_lock->temp_executed = TRUE;
 		client_output_cmd(client->output_lock);
diff -r a3e40c6b14fe -r f3aa8be626fa src/pop3/pop3-client.c
--- a/src/pop3/pop3-client.c	Thu Oct 14 16:53:04 2010 +0100
+++ b/src/pop3/pop3-client.c	Thu Oct 14 16:58:57 2010 +0100
@@ -641,6 +641,7 @@
 
 static int client_output(struct client *client)
 {
+	o_stream_cork(client->output);
 	if (o_stream_flush(client->output) < 0) {
 		client_destroy(client, NULL);
 		return 1;
@@ -651,11 +652,8 @@
 	if (client->to_commit != NULL)
 		timeout_reset(client->to_commit);
 
-	if (client->cmd != NULL) {
-		o_stream_cork(client->output);
+	if (client->cmd != NULL)
 		client->cmd(client);
-		o_stream_uncork(client->output);
-	}
 
 	if (client->cmd == NULL) {
 		if (o_stream_get_buffer_used_size(client->output) <
@@ -668,6 +666,7 @@
 			client_input(client);
 	}
 
+	o_stream_uncork(client->output);
 	return client->cmd == NULL;
 }
 


More information about the dovecot-cvs mailing list