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

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 6 00:38:54 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/b87a15fc462a
changeset: 10640:b87a15fc462a
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 dcfcedb32ea2 -r b87a15fc462a src/lib-index/mail-index-strmap.c
--- a/src/lib-index/mail-index-strmap.c	Sat Feb 06 00:36:11 2010 +0200
+++ b/src/lib-index/mail-index-strmap.c	Sat Feb 06 00:38:04 2010 +0200
@@ -742,7 +742,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