# HG changeset patch # User Timo Sirainen # Date 1138538497 -7200 # Node ID ccab957a03b3211e67d6649ea1e9612f62379b16 # Parent 9f607c5685fd453652cb31bacfa71ed3a956706f And the final fix for APPEND hangs ;) diff -r 9f607c5685fd -r ccab957a03b3 src/imap/client.c --- 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; diff -r 9f607c5685fd -r ccab957a03b3 src/imap/client.h --- 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 diff -r 9f607c5685fd -r ccab957a03b3 src/imap/cmd-append.c --- 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) diff -r 9f607c5685fd -r ccab957a03b3 src/imap/imap-sync.c --- 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