]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
APPEND: Uncork stream only after syncing and sending tagged reply.
authorTimo Sirainen <tss@iki.fi>
Fri, 13 Jun 2008 10:10:06 +0000 (13:10 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 13 Jun 2008 10:10:06 +0000 (13:10 +0300)
--HG--
branch : HEAD

src/imap/cmd-append.c

index 003b7690ca7c41ff98e032e53bc40cdd7538cf6f..cd1bd0826cfd663c4ad7621ce6053ed1a3fee7fc 100644 (file)
@@ -38,6 +38,7 @@ static void client_input_append(struct client_command_context *cmd)
 {
        struct cmd_append_context *ctx = cmd->context;
        struct client *client = cmd->client;
+       struct ostream *output = client->output;
        bool finished;
 
        i_assert(!client->destroyed);
@@ -73,15 +74,17 @@ static void client_input_append(struct client_command_context *cmd)
                return;
        }
 
-       o_stream_cork(client->output);
+       o_stream_ref(output);
+       o_stream_cork(output);
        finished = cmd->func(cmd);
-       o_stream_uncork(client->output);
        if (!finished && cmd->state != CLIENT_COMMAND_STATE_DONE)
                (void)client_handle_unfinished_cmd(cmd);
        else
                client_command_free(&cmd);
        (void)cmd_sync_delayed(client);
        client_continue_pending_input(&client);
+       o_stream_uncork(output);
+       o_stream_unref(&output);
 }
 
 /* Returns -1 = error, 0 = need more data, 1 = successful. flags and