[dovecot-cvs] dovecot/src/lib-index mail-index-sync-update.c, 1.67,
1.68
cras at dovecot.org
cras at dovecot.org
Tue Nov 30 11:20:27 EET 2004
Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv18487
Modified Files:
mail-index-sync-update.c
Log Message:
Sync handlers weren't always deinitialized with correct parameters.
Index: mail-index-sync-update.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-sync-update.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- mail-index-sync-update.c 29 Nov 2004 18:01:26 -0000 1.67
+++ mail-index-sync-update.c 30 Nov 2004 09:20:25 -0000 1.68
@@ -120,7 +120,8 @@
static void mail_index_sync_deinit_handlers(struct mail_index_sync_map_ctx *ctx)
{
- const struct mail_index_sync_handler *sync_handlers;
+ const struct mail_index_sync_handler *sync_handlers;
+ const struct mail_index_ext *ext;
size_t i, size;
if (ctx->extra_context == NULL)
@@ -131,10 +132,16 @@
i_assert(size <= ctx->extra_context_buf->used / sizeof(void *));
+ ext = ctx->view->map->extensions->data;
+ i_assert(ctx->view->map->extensions->used / sizeof(*ext) == size);
+
+ /* sync_handlers[] is ordered by index->extensions while
+ extra_context is ordered by map->extensions. */
for (i = 0; i < size; i++) {
if (ctx->extra_context[i] != NULL) {
- sync_handlers[i].callback(ctx, 0, NULL, NULL,
- &ctx->extra_context[i]);
+ sync_handlers[ext[i].index_idx].
+ callback(ctx, 0, NULL, NULL,
+ &ctx->extra_context[i]);
}
}
More information about the dovecot-cvs
mailing list