dovecot-1.2: lib-index: Changed strmap's crc32 field to be backw...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 6 01:21:03 EET 2010


details:   http://hg.dovecot.org/dovecot-1.2/rev/0454fde95cbf
changeset: 9539:0454fde95cbf
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Feb 06 00:38:04 2010 +0200
description:
lib-index: Changed strmap's crc32 field to be backwards compatible.

diffstat:

1 file changed, 4 insertions(+), 1 deletion(-)
src/lib-index/mail-index-strmap.c |    5 ++++-

diffs (15 lines):

diff -r c24a31b423ed -r 0454fde95cbf src/lib-index/mail-index-strmap.c
--- a/src/lib-index/mail-index-strmap.c	Sat Feb 06 01:16:26 2010 +0200
+++ b/src/lib-index/mail-index-strmap.c	Sat Feb 06 00:38:04 2010 +0200
@@ -741,7 +741,10 @@ mail_index_strmap_view_sync_init(struct 
 
 static inline uint32_t crc32_str_nonzero(const char *str)
 {
-	uint32_t value = crc32_str(str);
+	/* we'll flip the bits because of a bug in our old crc32 code.
+	   this keeps the index format backwards compatible with the new fixed
+	   crc32 code. */
+	uint32_t value = crc32_str(str) ^ 0xffffffffU;
 	return value == 0 ? 1 : value;
 }
 


More information about the dovecot-cvs mailing list