changeset 3811:03a2ff05bd12 HEAD

If append command failed because input line was too long (highly unlikely), we didn't properly reset flush callback.
author Timo Sirainen <tss@iki.fi>
date Wed, 04 Jan 2006 23:05:30 +0200
parents 4ed2033584b2
children 2881f7e79098
files src/imap/client.c src/imap/client.h src/imap/cmd-append.c
diffstat 3 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/client.c	Mon Jan 02 15:45:40 2006 +0200
+++ b/src/imap/client.c	Wed Jan 04 23:05:30 2006 +0200
@@ -15,6 +15,8 @@
 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 hin, int hout, struct namespace *namespaces)
 {
 	struct client *client;
@@ -250,6 +252,7 @@
 		client->io = io_add(i_stream_get_fd(client->input),
 				    IO_READ, _client_input, client);
 	}
+	o_stream_set_flush_callback(client->output, _client_output, client);
 
 	pool = client->cmd.pool;
 	memset(&client->cmd, 0, sizeof(client->cmd));
@@ -407,7 +410,7 @@
 		client_destroy(client);
 }
 
-int _client_output(void *context)
+static int _client_output(void *context)
 {
 	struct client *client = context;
 	struct client_command_context *cmd = &client->cmd;
--- a/src/imap/client.h	Mon Jan 02 15:45:40 2006 +0200
+++ b/src/imap/client.h	Wed Jan 04 23:05:30 2006 +0200
@@ -87,6 +87,5 @@
 
 void _client_reset_command(struct client *client);
 void _client_input(void *context);
-int _client_output(void *context);
 
 #endif
--- a/src/imap/cmd-append.c	Mon Jan 02 15:45:40 2006 +0200
+++ b/src/imap/cmd-append.c	Wed Jan 04 23:05:30 2006 +0200
@@ -61,8 +61,6 @@
 		/* command execution was finished */
 		client->bad_counter = 0;
 		_client_reset_command(client);
-		o_stream_set_flush_callback(client->output,
-					    _client_output, client);
 
 		if (client->input_pending)
 			_client_input(client);