doveadm-connection.c revision d2cadbf5445156fc12988506279d51d0e53b0449
/* 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 "master-service.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_PROTOCOL_VERSION_MAJOR 1
#define DOVEADM_HANDSHAKE "VERSION\tdirector-doveadm\t1\t0\n"
#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;
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;
}
static bool
{
struct user_directory_iter *iter;
if (*line != '\0') {
i_error("doveadm sent invalid USER-LIST parameters");
return FALSE;
}
} else {
}
"%u\t%u\t%s\n",
} T_END;
}
return TRUE;
}
{
if (!conn->handshaked) {
return;
}
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) {
}
}