]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: dsync-mailbox-export - Replace i_<log>() with e_<log>()
authorMarco Bettini <marco.bettini@open-xchange.com>
Wed, 31 Aug 2022 07:25:32 +0000 (07:25 +0000)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 6 Oct 2022 18:01:26 +0000 (18:01 +0000)
src/doveadm/dsync/dsync-brain-mailbox.c
src/doveadm/dsync/dsync-mailbox-export.c
src/doveadm/dsync/dsync-mailbox-export.h

index e7ef0c746af129f05b5e4901bad168718e2795b8..5ce5f60e8b3193ee28574b7c4c2f59894516b411 100644 (file)
@@ -353,7 +353,8 @@ int dsync_brain_sync_mailbox_open(struct dsync_brain *brain,
                                          last_common_uid,
                                          exporter_flags,
                                          brain->hdr_hash_version,
-                                         brain->hashed_headers);
+                                         brain->hashed_headers,
+                                         brain->event);
        dsync_brain_sync_mailbox_init_remote(brain, remote_dsync_box);
        return 1;
 }
index 27caed6aa48c73429a1e404a7b9b1dc1a138fcec..f701af93362c3220fab1326098740c1b94e882b6 100644 (file)
@@ -20,6 +20,7 @@ struct dsync_mail_guid_instances {
 
 struct dsync_mailbox_exporter {
        pool_t pool;
+       struct event *event;
        struct mailbox *box;
        struct dsync_transaction_log_scan *log_scan;
        uint32_t last_common_uid;
@@ -504,7 +505,8 @@ dsync_mailbox_export_init(struct mailbox *box,
                          uint32_t last_common_uid,
                          enum dsync_mailbox_exporter_flags flags,
                          unsigned int hdr_hash_version,
-                         const char *const *hashed_headers)
+                         const char *const *hashed_headers,
+                         struct event *parent_event)
 {
        struct dsync_mailbox_exporter *exporter;
        pool_t pool;
@@ -530,6 +532,7 @@ dsync_mailbox_export_init(struct mailbox *box,
        exporter->no_hdr_hashes =
                (flags & DSYNC_MAILBOX_EXPORTER_FLAG_NO_HDR_HASHES) != 0;
        exporter->hashed_headers = hashed_headers;
+       exporter->event = event_create(parent_event);
 
        p_array_init(&exporter->requested_uids, pool, 16);
        p_array_init(&exporter->search_uids, pool, 16);
@@ -641,7 +644,8 @@ dsync_mailbox_export_iter_next_attr(struct dsync_mailbox_exporter *exporter)
                if (attr_change != NULL && attr_change->exported) {
                        /* duplicate attribute returned.
                           shouldn't normally happen, but don't crash. */
-                       i_warning("Ignoring duplicate attributes '%s'", key);
+                       e_warning(exporter->event,
+                                 "Ignoring duplicate attributes '%s'", key);
                        continue;
                }
 
@@ -948,6 +952,7 @@ int dsync_mailbox_export_deinit(struct dsync_mailbox_exporter **_exporter,
 
        *error_r = exporter->mail_error;
        *errstr_r = t_strdup(exporter->error);
+       event_unref(&exporter->event);
        pool_unref(&exporter->pool);
        return *errstr_r != NULL ? -1 : 0;
 }
index 67e3216ad4b4101b665bf4a5f9ffa62b8c08638f..dfa6f029cc9c03518cf6847184d8140949136ed7 100644 (file)
@@ -16,7 +16,8 @@ dsync_mailbox_export_init(struct mailbox *box,
                          uint32_t last_common_uid,
                          enum dsync_mailbox_exporter_flags flags,
                          unsigned int hdr_hash_version,
-                         const char *const *hashed_headers);
+                         const char *const *hashed_headers,
+                         struct event *parent_event);
 /* Returns 1 if attribute was returned, 0 if no more attributes, -1 on error */
 int dsync_mailbox_export_next_attr(struct dsync_mailbox_exporter *exporter,
                                   const struct dsync_mailbox_attribute **attr_r);