[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-save.c, 1.82, 1.83

tss at dovecot.org tss at dovecot.org
Sun Mar 25 19:26:11 EEST 2007


Update of /var/lib/cvs/dovecot/src/lib-storage/index/maildir
In directory talvi:/tmp/cvs-serv3046

Modified Files:
	maildir-save.c 
Log Message:
Crashfix



Index: maildir-save.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-save.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- maildir-save.c	23 Mar 2007 20:23:24 -0000	1.82
+++ maildir-save.c	25 Mar 2007 16:26:09 -0000	1.83
@@ -229,12 +229,20 @@
 		if (mail_set_seq(dest_mail, ctx->seq) < 0)
 			i_unreached();
 
-		tee = tee_i_stream_create(ctx->input, default_pool);
-		ctx->input = tee_i_stream_create_child(tee, default_pool);
-		ctx->input2 = tee_i_stream_create_child(tee, default_pool);
+		if (ctx->input == NULL) {
+			/* FIXME: copying with hardlinking. we could copy the
+			   cached data directly */
+			ctx->cur_dest_mail = 0;
+		} else {
+			tee = tee_i_stream_create(ctx->input, default_pool);
+			ctx->input =
+				tee_i_stream_create_child(tee, default_pool);
+			ctx->input2 =
+				tee_i_stream_create_child(tee, default_pool);
 
-		index_mail_cache_parse_init(dest_mail, ctx->input2);
-		ctx->cur_dest_mail = dest_mail;
+			index_mail_cache_parse_init(dest_mail, ctx->input2);
+			ctx->cur_dest_mail = dest_mail;
+		}
 	} else {
 		ctx->seq = 0;
 		ctx->cur_dest_mail = NULL;



More information about the dovecot-cvs mailing list