/* Copyright (c) 2009-2018 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "llist.h"
#include "istream.h"
#include "ostream.h"
#include "strescape.h"
#include "master-service.h"
#include "master-interface.h"
#include "connect-limit.h"
#include "penalty.h"
#include "anvil-connection.h"
#include <unistd.h>
#define ANVIL_CLIENT_PROTOCOL_MINOR_VERSION 0
struct anvil_connection {
int fd;
};
static const char *const *
{
const char *line;
}
static int
{
args++;
*error_r = "CONNECT: Not enough parameters";
return -1;
}
*error_r = "CONNECT: Invalid pid";
return -1;
}
*error_r = "DISCONNECT: Not enough parameters";
return -1;
}
*error_r = "DISCONNECT: Invalid pid";
return -1;
}
*error_r = "KILL: Not enough parameters";
return -1;
}
*error_r = "KILL sent by a non-master connection";
return -1;
}
*error_r = "KILL: Invalid pid";
return -1;
}
*error_r = "LOOKUP: Not enough parameters";
return -1;
}
*error_r = "LOOKUP on a FIFO, can't send reply";
return -1;
}
*error_r = "PENALTY-GET: Not enough parameters";
return -1;
}
*error_r = "PENALTY-INC: Not enough parameters";
return -1;
}
value > PENALTY_MAX_VALUE ||
*error_r = "PENALTY-INC: Invalid parameters";
return -1;
}
*error_r = "PENALTY-SET-EXPIRE-SECS: "
"Invalid parameters";
return -1;
}
} else {
return -1;
}
return 0;
}
{
case -2:
i_error("BUG: Anvil client connection sent too much data");
return;
case -1:
return;
}
if (!conn->version_received) {
return;
/* old pending data. ignore input until we get
the handshake. */
return;
}
i_error("Anvil client not compatible with this server "
"(mixed old and new binaries?) %s", line);
return;
}
}
break;
}
}
}
}
struct anvil_connection *
{
if (!fifo) {
}
return conn;
}
{
i_error("close(anvil conn) failed: %m");
if (!fifo)
}
void anvil_connections_destroy_all(void)
{
while (anvil_connections != NULL)
}