]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
struct mail_storage.callbacks is no longer a pointer.
authorTimo Sirainen <tss@iki.fi>
Thu, 4 Jun 2009 22:58:38 +0000 (18:58 -0400)
committerTimo Sirainen <tss@iki.fi>
Thu, 4 Jun 2009 22:58:38 +0000 (18:58 -0400)
--HG--
branch : HEAD

src/lib-storage/index/index-search.c
src/lib-storage/index/index-storage.c
src/lib-storage/index/maildir/maildir-sync.c
src/lib-storage/mail-storage-private.h
src/lib-storage/mail-storage.c
src/plugins/fts/fts-storage.c

index cffa857276f2f31afb9e540db8a6d245c18db1ee..8afd4173383ac2b0b2498a40f36a95c04e47adb9 100644 (file)
@@ -1116,7 +1116,7 @@ static void index_storage_search_notify(struct mailbox *box,
                /* set the search time in here, in case a plugin
                   already spent some time indexing the mailbox */
                ctx->search_start_time = ioloop_timeval;
-       } else if (box->storage->callbacks->notify_ok != NULL &&
+       } else if (box->storage->callbacks.notify_ok != NULL &&
                   !ctx->mail_ctx.progress_hidden) {
                percentage = ctx->mail_ctx.progress_cur * 100.0 /
                        ctx->mail_ctx.progress_max;
@@ -1132,7 +1132,7 @@ static void index_storage_search_notify(struct mailbox *box,
                        text = t_strdup_printf("Searched %d%% of the mailbox, "
                                               "ETA %d:%02d", (int)percentage,
                                               secs/60, secs%60);
-                       box->storage->callbacks->
+                       box->storage->callbacks.
                                notify_ok(box, text,
                                          box->storage->callback_context);
                } T_END;
index 678cebbf32657073165820c6c069d0e6b9e64991..1bc71a1820c911f1437ecc013313df7188c2892e 100644 (file)
@@ -339,22 +339,22 @@ void index_storage_lock_notify(struct index_mailbox *ibox,
        case MAILBOX_LOCK_NOTIFY_NONE:
                break;
        case MAILBOX_LOCK_NOTIFY_MAILBOX_ABORT:
-               if (storage->callbacks->notify_no == NULL)
+               if (storage->callbacks.notify_no == NULL)
                        break;
 
                str = t_strdup_printf("Mailbox is locked, will abort in "
                                      "%u seconds", secs_left);
-               storage->callbacks->notify_no(&ibox->box, str,
-                                             storage->callback_context);
+               storage->callbacks.notify_no(&ibox->box, str,
+                                            storage->callback_context);
                break;
        case MAILBOX_LOCK_NOTIFY_MAILBOX_OVERRIDE:
-               if (storage->callbacks->notify_ok == NULL)
+               if (storage->callbacks.notify_ok == NULL)
                        break;
 
                str = t_strdup_printf("Stale mailbox lock file detected, "
                                      "will override in %u seconds", secs_left);
-               storage->callbacks->notify_ok(&ibox->box, str,
-                                             storage->callback_context);
+               storage->callbacks.notify_ok(&ibox->box, str,
+                                            storage->callback_context);
                break;
        }
 }
index 46a4f7816178e376dc055f6a8a08431a773cb889..6eca491d481672f6d5feceee83f7810f9248bf7c 100644 (file)
@@ -238,8 +238,8 @@ void maildir_sync_notify(struct maildir_sync_context *ctx)
        if (now - ctx->last_notify > MAIL_STORAGE_STAYALIVE_SECS) {
                struct mailbox *box = &ctx->mbox->ibox.box;
 
-               if (box->storage->callbacks->notify_ok != NULL) {
-                       box->storage->callbacks->
+               if (box->storage->callbacks.notify_ok != NULL) {
+                       box->storage->callbacks.
                                notify_ok(box, "Hang in there..",
                                          box->storage->callback_context);
                }
@@ -793,8 +793,8 @@ static int maildir_sync_context(struct maildir_sync_context *ctx, bool forced,
                        return -1;
                }
 
-               if (storage->callbacks->notify_no != NULL) {
-                       storage->callbacks->notify_no(&ctx->mbox->ibox.box,
+               if (storage->callbacks.notify_no != NULL) {
+                       storage->callbacks.notify_no(&ctx->mbox->ibox.box,
                                "Internal mailbox synchronization failure, "
                                "showing only old mails.",
                                storage->callback_context);
index 62d1446e195a0e28a30aeb1bdf6baf50cdc5ea8d..5320e4480c0b85683e06a49f6d5b059a65d1d719 100644 (file)
@@ -89,7 +89,7 @@ struct mail_storage {
 
        enum mail_storage_flags flags;
 
-       struct mail_storage_callbacks *callbacks;
+       struct mail_storage_callbacks callbacks;
        void *callback_context;
 
        /* Module-specific contexts. See mail_storage_module_id. */
index babdd39a291c3d8d3a994c526126830ca28b01ff..e3bb95a2399d740ea71166e41a14c88d1546c525 100644 (file)
@@ -286,9 +286,6 @@ int mail_storage_create(struct mail_namespace *ns, const char *driver,
        storage->user = ns->user;
        storage->set = ns->mail_set;
        storage->flags = flags;
-
-       storage->callbacks =
-               p_new(storage->pool, struct mail_storage_callbacks, 1);
        p_array_init(&storage->module_contexts, storage->pool, 5);
 
        if (storage->v.create != NULL &&
@@ -388,7 +385,7 @@ void mail_storage_set_callbacks(struct mail_storage *storage,
                                struct mail_storage_callbacks *callbacks,
                                void *context)
 {
-       *storage->callbacks = *callbacks;
+       storage->callbacks = *callbacks;
        storage->callback_context = context;
 }
 
index a067b611e4133572d340cd3060011ee74d85055b..18453da123c41005e2b0d7a3660ce85ac7fa8522 100644 (file)
@@ -480,7 +480,7 @@ static int fts_build_deinit(struct fts_storage_build_context **_ctx)
        if (ioloop_time - ctx->search_start_time.tv_sec >=
            FTS_BUILD_NOTIFY_INTERVAL_SECS) {
                /* we notified at least once */
-               box->storage->callbacks->
+               box->storage->callbacks.
                        notify_ok(box, "Mailbox indexing finished",
                                  box->storage->callback_context);
        }
@@ -502,7 +502,7 @@ static void fts_build_notify(struct fts_storage_build_context *ctx)
                /* set the search time in here, in case a plugin
                   already spent some time indexing the mailbox */
                ctx->search_start_time = ioloop_timeval;
-       } else if (box->storage->callbacks->notify_ok != NULL) {
+       } else if (box->storage->callbacks.notify_ok != NULL) {
                range = array_idx(&ctx->search_args->args->value.seqset, 0);
                percentage = (ctx->mail->seq - range->seq1) * 100.0 /
                        (range->seq2 - range->seq1);
@@ -518,7 +518,7 @@ static void fts_build_notify(struct fts_storage_build_context *ctx)
                        text = t_strdup_printf("Indexed %d%% of the mailbox, "
                                               "ETA %d:%02d", (int)percentage,
                                               secs/60, secs%60);
-                       box->storage->callbacks->
+                       box->storage->callbacks.
                                notify_ok(box, text,
                                box->storage->callback_context);
                } T_END;