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;
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;
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);
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;
}
*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;
}
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);