doveadm-connection.c revision 5e9bb72de1209cd39fdf3e95bdb26e047cc5594e
/* Copyright (c) 2010 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "network.h"
#include "istream.h"
#include "ostream.h"
#include "array.h"
#include "str.h"
#include "llist.h"
#include "user-directory.h"
#include "mail-host.h"
#include "director.h"
#include "director-host.h"
#include "director-request.h"
#include "doveadm-connection.h"
#include <unistd.h>
#define DOVEADM_HANDSHAKE_EXPECTED "VERSION\tdirector-doveadm\t1\t"
#define MAX_VALID_VHOST_COUNT 1000
struct doveadm_connection {
int fd;
unsigned int handshaked:1;
};
static struct doveadm_connection *doveadm_connections;
{
(*hostp)->user_count);
}
}
{
struct director_host *const *hostp;
}
}
static bool
{
const char *const *args;
unsigned int vhost_count = -1U;
i_error("doveadm sent invalid HOST-SET parameters");
return FALSE;
}
return TRUE;
}
if (vhost_count != -1U)
return TRUE;
}
static bool
{
i_error("doveadm sent invalid HOST-REMOVE parameters");
return FALSE;
}
else {
}
return TRUE;
}
static void
{
}
static bool
{
if (*line == '\0') {
return TRUE;
}
i_error("doveadm sent invalid HOST-FLUSH parameters");
return FALSE;
}
else {
}
return TRUE;
}
static bool
{
unsigned int username_hash;
/* get user's current host */
else {
}
/* get host if it wasn't in user directory */
else
/* get host with default configuration */
else
return TRUE;
}
{
if (!conn->handshaked) {
return;
strlen(DOVEADM_HANDSHAKE_EXPECTED)) != 0) {
i_error("doveadm not compatible with this server "
"(mixed old and new binaries?)");
return;
}
}
args = "";
} else {
args++;
}
else {
}
}
}
struct doveadm_connection *
{
struct doveadm_connection *conn;
return conn;
}
{
i_error("close(doveadm connection) failed: %m");
}
void doveadm_connections_deinit(void)
{
while (doveadm_connections != NULL) {
}
}