[dovecot-cvs] dovecot/src/lib-index mail-cache.c,1.44,1.45
cras at dovecot.org
cras at dovecot.org
Wed Jul 28 19:31:56 EEST 2004
- Previous message: [dovecot-cvs] dovecot/src/auth Makefile.am, 1.29, 1.30 mech-ntlm.c,
NONE, 1.1 mech.c, 1.28, 1.29 passdb.c, 1.19, 1.20 passdb.h,
1.10, 1.11 password-scheme-ntlm.c, NONE, 1.1 password-scheme.c,
1.10, 1.11 password-scheme.h, 1.4, 1.5
- Next message: [dovecot-cvs] dovecot/src/lib-storage/index/mbox
mbox-sync-rewrite.c, 1.25, 1.26
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv30506
Modified Files:
mail-cache.c
Log Message:
mail_cache_lock() crashed if index wasn't locked while it was called.
Index: mail-cache.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-cache.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- mail-cache.c 24 Jul 2004 21:19:20 -0000 1.44
+++ mail-cache.c 28 Jul 2004 16:31:54 -0000 1.45
@@ -265,6 +265,7 @@
int mail_cache_lock(struct mail_cache *cache)
{
+ unsigned int lock_id;
int i, ret;
i_assert(!cache->locked);
@@ -272,10 +273,15 @@
if (MAIL_CACHE_IS_UNUSABLE(cache))
return 0;
+ if (mail_index_lock_shared(cache->index, TRUE, &lock_id) < 0)
+ return -1;
+
if (cache->hdr->file_seq != cache->index->hdr->cache_file_seq) {
/* we want the latest cache file */
- if ((ret = mail_cache_reopen(cache)) <= 0)
+ if ((ret = mail_cache_reopen(cache)) <= 0) {
+ mail_index_unlock(cache->index, lock_id);
return ret;
+ }
}
for (i = 0; i < 3; i++) {
@@ -293,13 +299,14 @@
/* okay, so it was just compressed. try again. */
mail_cache_unlock(cache);
if ((ret = mail_cache_reopen(cache)) <= 0)
- return ret;
+ break;
ret = 0;
}
if (ret > 0)
cache->hdr_copy = *cache->hdr;
+ mail_index_unlock(cache->index, lock_id);
return ret;
}
- Previous message: [dovecot-cvs] dovecot/src/auth Makefile.am, 1.29, 1.30 mech-ntlm.c,
NONE, 1.1 mech.c, 1.28, 1.29 passdb.c, 1.19, 1.20 passdb.h,
1.10, 1.11 password-scheme-ntlm.c, NONE, 1.1 password-scheme.c,
1.10, 1.11 password-scheme.h, 1.4, 1.5
- Next message: [dovecot-cvs] dovecot/src/lib-storage/index/mbox
mbox-sync-rewrite.c, 1.25, 1.26
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list