[dovecot-cvs] dovecot/src/lib-index mail-index-transaction.c, 1.19, 1.20

cras at dovecot.org cras at dovecot.org
Fri Jul 30 12:30:54 EEST 2004


Update of /home/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv10899/src/lib-index

Modified Files:
	mail-index-transaction.c 
Log Message:
Growing index record size in the middle of transaction wasn't working right.



Index: mail-index-transaction.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-index-transaction.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- mail-index-transaction.c	10 Jul 2004 11:16:05 -0000	1.19
+++ mail-index-transaction.c	30 Jul 2004 09:30:51 -0000	1.20
@@ -178,7 +178,7 @@
 		size /= t->append_record_size;
 
 		new_buf = buffer_create_dynamic(default_pool,
-						size * new_record_size,
+						(size + 10) * new_record_size,
 						(size_t)-1);
 		for (i = 0; i < size; i++) {
 			dest = buffer_append_space_unsafe(new_buf,
@@ -186,6 +186,8 @@
 			memcpy(dest, src, t->append_record_size);
 			src = CONST_PTR_OFFSET(src, t->append_record_size);
 		}
+		buffer_free(t->appends);
+		t->appends = new_buf;
 	}
 
 	t->append_record_size = new_record_size;



More information about the dovecot-cvs mailing list