/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "ioloop.h"
#include "dsync-client.h"
#include "replicator-settings.h"
#include "replicator-queue.h"
#include "replicator-brain.h"
struct replicator_sync_context {
};
struct replicator_brain {
};
{
}
struct replicator_brain *
const struct replicator_settings *set)
{
return brain;
}
{
}
struct replicator_queue *
{
}
const struct replicator_settings *
{
}
{
return &brain->dsync_clients;
}
static struct dsync_client *
{
if (!dsync_client_is_busy(*connp))
return *connp;
}
return NULL;
return conn;
}
void *context)
{
if (!replicator_user_unref(&user)) {
/* user was already removed */
} else if (reply == DSYNC_REPLY_NOUSER ||
reply == DSYNC_REPLY_NOREPLICATE) {
/* user no longer exists, or is not wanted for replication,
remove from replication */
} else {
if (reply == DSYNC_REPLY_OK)
}
}
static bool
{
bool full;
return FALSE;
/* update the sync times immediately. if the replication fails we still
wouldn't want it to be retried immediately. */
}
/* reset priority also. if more updates arrive during replication
we'll do another replication to make sure nothing gets lost */
return TRUE;
}
{
}
{
unsigned int next_secs;
/* nothing more to do */
return FALSE;
}
/* all connections were full, put the user back to queue */
return FALSE;
}
/* replication started for the user */
return TRUE;
}
{
while (replicator_brain_fill_next(brain)) ;
}