[dovecot-cvs] dovecot/src/imap cmd-append.c,1.60,1.61

cras at dovecot.org cras at dovecot.org
Fri Jun 17 23:30:15 EEST 2005


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv16039

Modified Files:
	cmd-append.c 
Log Message:
APPEND was broken because of recent eof-change in istream-limit.



Index: cmd-append.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-append.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- cmd-append.c	2 Apr 2005 21:08:56 -0000	1.60
+++ cmd-append.c	17 Jun 2005 20:30:12 -0000	1.61
@@ -289,7 +289,7 @@
 	struct client *client = cmd->client;
 	struct cmd_append_context *ctx = cmd->context;
 	size_t size;
-	int failed;
+	int failed, all_written;
 
 	if (ctx->save_ctx != NULL) {
 		if (mailbox_save_continue(ctx->save_ctx) < 0 ||
@@ -307,7 +307,8 @@
 		i_stream_skip(ctx->input, size);
 	}
 
-	if (ctx->input->v_offset == ctx->msg_size || client->input->closed) {
+	all_written = ctx->input->v_offset == ctx->msg_size;
+	if (all_written || client->input->closed) {
 		/* finished */
 		i_stream_unref(ctx->input);
 		ctx->input = NULL;
@@ -316,7 +317,7 @@
 			/* failed above */
 			client_send_storage_error(cmd, ctx->storage);
 			failed = TRUE;
-		} else if (client->input->eof) {
+		} else if (!all_written) {
 			/* client disconnected */
 			failed = TRUE;
 			mailbox_save_cancel(ctx->save_ctx);



More information about the dovecot-cvs mailing list