[dovecot-cvs] dovecot/src/lib-index mail-cache.c,1.69,1.70

cras at dovecot.org cras at dovecot.org
Sat May 14 15:30:18 EEST 2005


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv7896

Modified Files:
	mail-cache.c 
Log Message:
Pointers into file cache may change as a result of file_cache_write().



Index: mail-cache.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- mail-cache.c	14 May 2005 11:29:36 -0000	1.69
+++ mail-cache.c	14 May 2005 12:30:16 -0000	1.70
@@ -473,8 +473,14 @@
 		return -1;
 	}
 
-	if (cache->file_cache != NULL)
+	if (cache->file_cache != NULL) {
 		file_cache_write(cache->file_cache, data, size, offset);
+
+		/* data/hdr pointers may change if file cache was grown */
+		cache->data = file_cache_get_map(cache->file_cache,
+						 &cache->mmap_length);
+		cache->hdr = cache->data;
+	}
 	return 0;
 }
 



More information about the dovecot-cvs mailing list