[dovecot-cvs] dovecot/src/lib-index mail-index-sync-update.c, 1.82,
1.83
cras at dovecot.org
cras at dovecot.org
Sun Apr 17 00:41:24 EEST 2005
Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv32190
Modified Files:
mail-index-sync-update.c
Log Message:
If we're updating only log_file_ext_offset but log file sequence has
changed, update log_file_int_offset also to beginning of next file. Fixes
assert in mail_transaction_log_view_set().
Index: mail-index-sync-update.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-sync-update.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- mail-index-sync-update.c 12 Mar 2005 18:16:29 -0000 1.82
+++ mail-index-sync-update.c 16 Apr 2005 21:41:22 -0000 1.83
@@ -8,6 +8,7 @@
#include "mail-index-view-private.h"
#include "mail-index-sync-private.h"
#include "mail-transaction-log.h"
+#include "mail-transaction-log-private.h"
#include "mail-transaction-util.h"
void mail_index_sync_replace_map(struct mail_index_sync_map_ctx *ctx,
@@ -668,9 +669,16 @@
mail_transaction_log_get_head(index->log, &seq, &offset);
- map->hdr.log_file_seq = seq;
if (!sync_only_external)
map->hdr.log_file_int_offset = offset;
+ else if (map->hdr.log_file_seq != seq) {
+ /* log sequence changed. update internal offset to
+ beginning of the new file. */
+ i_assert(map->hdr.log_file_int_offset ==
+ index->log->head->hdr.prev_file_offset);
+ map->hdr.log_file_int_offset = index->log->head->hdr.hdr_size;
+ }
+ map->hdr.log_file_seq = seq;
map->hdr.log_file_ext_offset = offset;
if (first_append_uid != 0)
More information about the dovecot-cvs
mailing list