static void dsync_brain_sync_mailboxes(struct dsync_brain *brain)
{
- struct dsync_mailbox *const *src_boxes, *const *dest_boxes, *action_box;
+ struct dsync_mailbox *const *src_boxes, *const *dest_boxes;
+ struct dsync_mailbox *action_box = NULL;
+ struct dsync_worker *action_worker = NULL;
unsigned int src, dest, src_count, dest_count;
enum dsync_brain_mailbox_action action;
- struct dsync_worker *action_worker;
bool src_deleted, dest_deleted;
int ret;
struct dsync_mailbox *const *src_boxes, *const *dest_boxes, *action_box;
unsigned int src, dest, src_count, dest_count;
enum dsync_brain_mailbox_action action;
- struct dsync_worker *action_worker;
+ struct dsync_worker *action_worker = NULL;
bool src_deleted, dest_deleted;
int ret;
dest_boxes = array_get(&brain->dest_mailbox_list->dirs, &dest_count);
for (src = dest = 0; src < src_count && dest < dest_count; ) {
action = DSYNC_BRAIN_MAILBOX_ACTION_NONE;
+ action_box = NULL;
+
src_deleted = (src_boxes[src]->flags &
DSYNC_MAILBOX_FLAG_DELETED_DIR) != 0;
dest_deleted = (dest_boxes[dest]->flags &
} else {
src++; dest++;
}
- i_assert(dsync_mailbox_is_noselect(action_box));
+ i_assert(action_box == NULL ||
+ dsync_mailbox_is_noselect(action_box));
dsync_brain_mailbox_action(brain, action,
action_worker, action_box);
}