[dovecot-cvs] dovecot/src/lib-index mail-index-transaction.c, 1.3,
1.4
cras at procontrol.fi
cras at procontrol.fi
Mon May 17 02:12:51 EEST 2004
- Previous message: [dovecot-cvs] dovecot/src/imap cmd-sort.c, 1.14, 1.15 cmd-thread.c,
1.6, 1.7 imap-sort.c, 1.10, 1.11 imap-thread.c, 1.8, 1.9
- Next message: [dovecot-cvs] dovecot/src/lib file-dotlock.c,1.12,1.13
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv1937
Modified Files:
mail-index-transaction.c
Log Message:
Don't remove flag changes in transaction log if they're expunged
Index: mail-index-transaction.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-index-transaction.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mail-index-transaction.c 2 May 2004 20:32:16 -0000 1.3
+++ mail-index-transaction.c 16 May 2004 23:12:49 -0000 1.4
@@ -34,66 +34,6 @@
i_free(t);
}
-static void
-mail_index_transaction_expunge_updates(struct mail_index_transaction *t)
-{
- /* FIXME: is this useful? do we even want this? */
- const struct mail_transaction_expunge *expunges, *last_expunge;
- struct mail_transaction_flag_update *updates;
- size_t expunge_size, update_count, i, dest;
- uint32_t seq1, seq2;
- int cut;
-
- expunges = buffer_get_data(t->expunges, &expunge_size);
- last_expunge = CONST_PTR_OFFSET(expunges, expunge_size);
-
- if (expunge_size == 0)
- return;
-
- updates = buffer_get_modifyable_data(t->updates, &update_count);
- update_count /= sizeof(*updates);
-
- /* Cut off the updates that contain expunged messages. However if
- the cutting would require creating another flag update entry
- (eg. updates=1..3, expunge=2), don't do it. */
- for (i = 0, dest = 0; i < update_count; i++) {
- while (expunges->seq2 < updates[i].seq1) {
- if (++expunges == last_expunge)
- break;
- }
-
- cut = FALSE;
- if (expunges->seq1 <= updates[i].seq2) {
- /* they're overlapping at least partially */
- seq1 = I_MIN(expunges->seq1, updates[i].seq1);
- seq2 = I_MAX(expunges->seq2, updates[i].seq2);
-
- if (seq1 == expunges->seq1 && seq2 == expunges->seq2) {
- /* cut it off completely */
- cut = TRUE;
- } else if (seq1 == expunges->seq1) {
- /* cut the beginning */
- updates[i].seq1 = expunges->seq2+1;
- } else if (seq2 == expunges->seq2) {
- /* cut the end */
- updates[i].seq2 = expunges->seq1-1;
- } else {
- /* expunge range is in the middle -
- don't bother cutting it */
- }
- }
-
- if (!cut) {
- if (i != dest)
- updates[dest] = updates[i];
- dest++;
- }
- }
-
- if (i != dest)
- buffer_set_used_size(t->updates, dest * sizeof(*updates));
-}
-
int mail_index_transaction_commit(struct mail_index_transaction *t,
uint32_t *log_file_seq_r,
uoff_t *log_file_offset_r)
@@ -107,8 +47,6 @@
if (t->last_update.seq1 != 0)
mail_index_transaction_add_last(t);
- if (t->updates != NULL && t->expunges != NULL)
- mail_index_transaction_expunge_updates(t);
ret = mail_transaction_log_append(t, log_file_seq_r, log_file_offset_r);
- Previous message: [dovecot-cvs] dovecot/src/imap cmd-sort.c, 1.14, 1.15 cmd-thread.c,
1.6, 1.7 imap-sort.c, 1.10, 1.11 imap-thread.c, 1.8, 1.9
- Next message: [dovecot-cvs] dovecot/src/lib file-dotlock.c,1.12,1.13
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list