changeset 3963:ccab957a03b3 HEAD

And the final fix for APPEND hangs ;)
author Timo Sirainen <tss@iki.fi>
date Sun, 29 Jan 2006 14:41:37 +0200
parents 9f607c5685fd
children 7dc2460ff0b7
files src/imap/client.c src/imap/client.h src/imap/cmd-append.c src/imap/imap-sync.c
diffstat 4 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/client.c	Sun Jan 29 14:33:13 2006 +0200
+++ b/src/imap/client.c	Sun Jan 29 14:41:37 2006 +0200
@@ -16,8 +16,6 @@
 static struct client *my_client; /* we don't need more than one currently */
 static struct timeout *to_idle;
 
-static int _client_output(void *context);
-
 struct client *client_create(int fd_in, int fd_out,
 			     struct namespace *namespaces)
 {
@@ -426,7 +424,7 @@
 		client_destroy(client);
 }
 
-static int _client_output(void *context)
+int _client_output(void *context)
 {
 	struct client *client = context;
 	struct client_command_context *cmd = &client->cmd;
--- a/src/imap/client.h	Sun Jan 29 14:33:13 2006 +0200
+++ b/src/imap/client.h	Sun Jan 29 14:41:37 2006 +0200
@@ -89,5 +89,6 @@
 
 void _client_reset_command(struct client *client);
 void _client_input(void *context);
+int _client_output(void *context);
 
 #endif
--- a/src/imap/cmd-append.c	Sun Jan 29 14:33:13 2006 +0200
+++ b/src/imap/cmd-append.c	Sun Jan 29 14:41:37 2006 +0200
@@ -126,6 +126,8 @@
 		mailbox_close(&ctx->box);
 
 	ctx->client->bad_counter = 0;
+	o_stream_set_flush_callback(ctx->client->output,
+				    _client_output, ctx->client);
 }
 
 static bool cmd_append_continue_cancel(struct client_command_context *cmd)
--- a/src/imap/imap-sync.c	Sun Jan 29 14:33:13 2006 +0200
+++ b/src/imap/imap-sync.c	Sun Jan 29 14:41:37 2006 +0200
@@ -216,10 +216,6 @@
 		return TRUE;
 	}
 
-	/* make sure that flush callback gets set to normal. this is
-	   currently needed only with APPEND. */
-	_client_reset_command(cmd->client);
-
 	if ((client_workarounds & WORKAROUND_DELAY_NEWMAIL) != 0 &&
 	    (flags & MAILBOX_SYNC_FLAG_FAST) != 0) {
 		/* expunges might break just as badly as new mail