[dovecot-cvs] dovecot/src/plugins/fts-squat squat-trie.c, 1.15, 1.16 squat-uidlist.c, 1.11, 1.12

tss at dovecot.org tss at dovecot.org
Sun Mar 25 23:26:55 EEST 2007


Update of /var/lib/cvs/dovecot/src/plugins/fts-squat
In directory talvi:/tmp/cvs-serv8181

Modified Files:
	squat-trie.c squat-uidlist.c 
Log Message:
fixes



Index: squat-trie.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/fts-squat/squat-trie.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- squat-trie.c	15 Mar 2007 17:02:19 -0000	1.15
+++ squat-trie.c	25 Mar 2007 20:26:53 -0000	1.16
@@ -1746,7 +1746,7 @@
 		node_pack_leaf(trie->buf, node);
 	} else {
 		struct trie_node **children8 = NODE_CHILDREN8(node);
-		struct trie_node **children16 = NODE_CHILDREN16(node, 0);
+		struct trie_node **children16;
 
 		if ((ret = squat_trie_compress_children(ctx, children8,
 							node->chars_8bit_count,
@@ -1754,6 +1754,8 @@
 			return -1;
 		if (ret == 0)
 			squat_trie_compress_chars8(node);
+
+		children16 = NODE_CHILDREN16(node, 0);
 		if ((ret = squat_trie_compress_children(ctx, children16,
 							node->chars_16bit_count,
 							level + 1)) < 0)

Index: squat-uidlist.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/fts-squat/squat-uidlist.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- squat-uidlist.c	16 Jan 2007 17:00:41 -0000	1.11
+++ squat-uidlist.c	25 Mar 2007 20:26:53 -0000	1.12
@@ -110,6 +110,11 @@
 				      const struct squat_uidlist_header *hdr,
 				      uoff_t file_size)
 {
+	if (hdr->used_file_size == 0) {
+		/* crashed before writing was finished */
+		return -1;
+	}
+
 	if (hdr->uidvalidity != uidlist->uidvalidity) {
 		squat_trie_set_corrupted(uidlist->trie,
 					 "uidlist: uidvalidity changed");
@@ -277,7 +282,8 @@
 	uidlist->mmap_disable = mmap_disable;
 	i_array_init(&uidlist->lists, 65536);
 	uidlist->node_pool =
-		pool_alloconly_create("squat uidlist node pool", 65536);
+		pool_alloconly_create(MEMPOOL_GROWING"squat uidlist node pool",
+				      65536);
 	uidlist->tmp_buf = buffer_create_dynamic(default_pool, 16);
 	uidlist->list_buf = buffer_create_dynamic(default_pool, 256);
 	return uidlist;



More information about the dovecot-cvs mailing list