[dovecot-cvs] dovecot/src/lib-index mail-cache-sync-update.c, 1.3, 1.4

cras at dovecot.org cras at dovecot.org
Mon Nov 29 02:27:50 EET 2004


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

Modified Files:
	mail-cache-sync-update.c 
Log Message:
Don't crash if cache is unusable.



Index: mail-cache-sync-update.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache-sync-update.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mail-cache-sync-update.c	8 Nov 2004 01:21:14 -0000	1.3
+++ mail-cache-sync-update.c	29 Nov 2004 00:27:47 -0000	1.4
@@ -77,6 +77,9 @@
 	if (*cache_offset == 0)
 		return 1;
 
+	if (MAIL_CACHE_IS_UNUSABLE(cache))
+		return 1;
+
 	ret = mail_cache_handler_init(&ctx, cache);
 	*context = ctx;
 	if (ret <= 0)
@@ -110,6 +113,9 @@
 		return 1;
 	}
 
+	if (MAIL_CACHE_IS_UNUSABLE(cache))
+		return 1;
+
 	if (cache->file_cache != NULL) {
 		file_cache_invalidate(cache->file_cache, *new_cache_offset,
 				      (size_t)-1);



More information about the dovecot-cvs mailing list