changeset 3402:513abd166949 HEAD

Changed output handler to work a bit differently to avoid useless io_remove/io_add calls.
author Timo Sirainen <tss@iki.fi>
date Sun, 29 May 2005 13:50:43 +0300
parents c19d6448f856
children e64f8694b3f3
files src/imap/client.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/client.c	Sun May 29 13:50:06 2005 +0300
+++ b/src/imap/client.c	Sun May 29 13:50:43 2005 +0300
@@ -411,12 +411,14 @@
 	o_stream_cork(client->output);
 	client->output_pending = TRUE;
 	finished = cmd->func(cmd) || cmd->param_error;
-	o_stream_uncork(client->output);
 
-	/* a bit kludgy. normally we would want to get back here, but IDLE
-	   is a special case which has command pending but without necessarily
-	   anything to write. */
-	ret = finished || !client->output_pending;
+	/* a bit kludgy check. normally we would want to get back to this
+	   output handler, but IDLE is a special case which has command
+	   pending but without necessarily anything to write. */
+	if (!finished && client->output_pending)
+		o_stream_set_flush_pending(client->output, TRUE);
+
+	o_stream_uncork(client->output);
 
 	if (finished) {
 		/* command execution was finished */