doveadm-connection.c revision b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011
/* 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-SET parameters");
return FALSE;
}
else {
}
return TRUE;
}
static bool
{
unsigned int hash;
else {
}
return TRUE;
}
{
const char *line;
if (!conn->handshaked) {
return;
strlen(DOVEADM_HANDSHAKE_EXPECTED)) != 0) {
i_error("doveadm not compatible with this server "
"(mixed old and new binaries?)");
return;
}
}
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) {
}
}