[dovecot-cvs] dovecot/src/lib-storage/index index-storage.h, 1.123, 1.124 index-transaction.c, 1.21, 1.22
tss at dovecot.org
tss at dovecot.org
Tue Apr 17 20:17:59 EEST 2007
Update of /var/lib/cvs/dovecot/src/lib-storage/index
In directory talvi:/tmp/cvs-serv1559/index
Modified Files:
index-storage.h index-transaction.c
Log Message:
Fixed mailbox_transaction_commit_get_uids() to actually work and not just
crash.
Index: index-storage.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.h,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -d -r1.123 -r1.124
--- index-storage.h 17 Apr 2007 16:40:56 -0000 1.123
+++ index-storage.h 17 Apr 2007 17:17:52 -0000 1.124
@@ -82,7 +82,7 @@
struct mail_cache_view *cache_view;
struct mail_cache_transaction_ctx *cache_trans;
- uint32_t first_saved_uid, last_saved_uid;
+ uint32_t *first_saved_uid, *last_saved_uid;
unsigned int cache_trans_failed:1;
};
Index: index-transaction.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-transaction.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- index-transaction.c 17 Apr 2007 16:40:56 -0000 1.21
+++ index-transaction.c 17 Apr 2007 17:17:55 -0000 1.22
@@ -89,15 +89,13 @@
uint32_t seq;
uoff_t offset;
+ *first_saved_uid_r = *last_saved_uid_r = 0;
+
t->commit_flags = flags;
- if (mail_index_transaction_commit(&itrans, &seq, &offset) < 0)
- return -1;
+ t->first_saved_uid = first_saved_uid_r;
+ t->last_saved_uid = last_saved_uid_r;
- if (t->first_saved_uid <= t->last_saved_uid) {
- *first_saved_uid_r = t->first_saved_uid;
- *last_saved_uid_r = t->last_saved_uid;
- }
- return 0;
+ return mail_index_transaction_commit(&itrans, &seq, &offset);
}
void index_transaction_rollback(struct mailbox_transaction_context *_t)
More information about the dovecot-cvs
mailing list