[dovecot-cvs] dovecot/src/imap cmd-append.c,1.81,1.82

cras at dovecot.org cras at dovecot.org
Tue May 30 11:25:27 EEST 2006


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

Modified Files:
	cmd-append.c 
Log Message:
If connection closes while appending, we crashed in some situations.



Index: cmd-append.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-append.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- cmd-append.c	9 May 2006 11:57:36 -0000	1.81
+++ cmd-append.c	30 May 2006 08:25:24 -0000	1.82
@@ -143,7 +143,8 @@
 	(void)i_stream_get_data(ctx->input, &size);
 	i_stream_skip(ctx->input, size);
 
-	if (ctx->input->v_offset == ctx->msg_size || ctx->input->closed) {
+	if (ctx->input->v_offset == ctx->msg_size ||
+	    cmd->client->input->closed) {
 		cmd_append_finish(ctx);
 		return TRUE;
 	}
@@ -273,7 +274,7 @@
 					   ctx->msg_size);
 	ret = mailbox_save_init(ctx->t, flags, keywords,
 				internal_date, timezone_offset, NULL,
-				ctx->input, NULL, &ctx->save_ctx);
+				ctx->input, FALSE, &ctx->save_ctx);
 
 	if (keywords != NULL)
 		mailbox_keywords_free(ctx->t, &keywords);
@@ -335,7 +336,7 @@
 			   whole message. */
 			failed = TRUE;
 			mailbox_save_cancel(&ctx->save_ctx);
-		} else if (mailbox_save_finish(&ctx->save_ctx) < 0) {
+		} else if (mailbox_save_finish(&ctx->save_ctx, NULL) < 0) {
 			failed = TRUE;
 			client_send_storage_error(cmd, ctx->storage);
 		} else {



More information about the dovecot-cvs mailing list