[dovecot-cvs] dovecot/src/lib-index mail-cache-lookup.c,1.5,1.6
cras at procontrol.fi
cras at procontrol.fi
Wed Jun 23 16:43:38 EEST 2004
Update of /home/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv418/lib-index
Modified Files:
mail-cache-lookup.c
Log Message:
Crashfixes for disabled cache.
Index: mail-cache-lookup.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-cache-lookup.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- mail-cache-lookup.c 22 Jun 2004 07:36:33 -0000 1.5
+++ mail-cache-lookup.c 23 Jun 2004 13:43:36 -0000 1.6
@@ -13,6 +13,9 @@
uint32_t offset, data_size;
unsigned char *buf;
+ if (cache->disabled)
+ return NULL;
+
offset = mail_cache_offset_to_uint32(cache->hdr->header_offsets[idx]);
if (offset == 0)
@@ -90,6 +93,9 @@
i_assert(idx < MAIL_CACHE_HEADERS_COUNT);
+ if (view->cache->disabled)
+ return NULL;
+
/* t_strsplit() is a bit slow, so we cache it */
if (cache->hdr->header_offsets[idx] != cache->split_offsets[idx]) {
p_clear(cache->split_header_pool);
More information about the dovecot-cvs
mailing list