director.c revision 883c882ede03123e771e5f1cd1d4fbdbddafd6c2
/* Copyright (c) 2010 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "array.h"
#include "str.h"
#include "user-directory.h"
#include "mail-host.h"
#include "director-host.h"
#include "director-connection.h"
#include "director.h"
#define DIRECTOR_RECONNECT_RETRY_SECS 60
{
return FALSE;
return FALSE;
return TRUE;
}
{
struct director_host *const *hosts;
unsigned int i, count;
for (i = 0; i < count; i++) {
return;
}
}
i_fatal("director_servers doesn't list ourself");
}
{
return;
if (!director_is_self_ip_set(dir))
i_fatal("director_servers doesn't list ourself (%s:%u)",
}
}
{
struct director_host *const *hosts;
unsigned int i, count;
for (i = 0; i < count; i++) {
return i;
}
i_unreached();
}
{
unsigned int port;
int fd;
i_debug("Connecting to %s:%u",
}
if (fd == -1) {
return -1;
}
return 0;
}
{
struct director_host *const *hosts;
/* try to connect to first working server on our right side.
the left side is supposed to connect to us. */
for (i = 1; i < count; i++) {
/* failed recently, don't try retrying here */
continue;
}
break;
}
if (i == count) {
/* we're the only one */
}
}
{
if (dir->ring_handshake_warning_sent) {
i_warning("Directors have been connected, "
"continuing delayed connections");
}
i_debug("Director ring handshaked");
}
{
/* we're synced again, once we receive this SYNC back */
i_debug("Ring is desynced (seq=%u, sending SYNC to %s)",
}
}
{
}
{
}
{
}
{
}
{
}
const char *cmd)
{
}
struct director *
{
return dir;
}
{
struct director_host *const *hostp;
}