conn = p_new(pool, struct client_connection_http, 1);
if (client_connection_init(&conn->conn,
- CLIENT_CONNECTION_TYPE_HTTP, pool, fd) < 0) {
+ DOVEADM_CONNECTION_TYPE_HTTP, pool, fd) < 0) {
pool_unref(&conn->conn.pool);
return NULL;
}
const char *cmd_name);
int client_connection_init(struct client_connection *conn,
- enum doveadm_client_connection_type type, pool_t pool, int fd);
+ enum doveadm_client_type type, pool_t pool, int fd);
void client_connection_destroy(struct client_connection **_conn);
void client_connection_set_proctitle(struct client_connection *conn,
struct client_connection_tcp *conn = NULL;
if (doveadm_client != NULL &&
- doveadm_client->type == CLIENT_CONNECTION_TYPE_TCP)
+ doveadm_client->type == DOVEADM_CONNECTION_TYPE_TCP)
conn = (struct client_connection_tcp *)doveadm_client;
if (!log_recursing && conn != NULL &&
struct client_connection_tcp *conn =
(struct client_connection_tcp *)_conn;
- i_assert(_conn->type == CLIENT_CONNECTION_TYPE_TCP);
+ i_assert(_conn->type == DOVEADM_CONNECTION_TYPE_TCP);
doveadm_print_deinit();
doveadm_print_ostream = NULL;
conn->fd = fd;
if (client_connection_init(&conn->conn,
- CLIENT_CONNECTION_TYPE_TCP, pool, fd) < 0) {
+ DOVEADM_CONNECTION_TYPE_TCP, pool, fd) < 0) {
client_connection_tcp_destroy(&conn);
return NULL;
}
}
int client_connection_init(struct client_connection *conn,
- enum doveadm_client_connection_type type, pool_t pool, int fd)
+ enum doveadm_client_type type, pool_t pool, int fd)
{
const char *ip;
- i_assert(type != CLIENT_CONNECTION_TYPE_CLI);
+ i_assert(type != DOVEADM_CONNECTION_TYPE_CLI);
conn->type = type;
conn->pool = pool;
struct client_connection {
pool_t pool;
- enum doveadm_client_connection_type type;
+ enum doveadm_client_type type;
const char *name;
struct ip_addr local_ip, remote_ip;
struct ip_addr local_ip, remote_ip;
in_port_t local_port, remote_port;
- enum doveadm_client_connection_type conn_type;
+ enum doveadm_client_type conn_type;
struct istream *input;
struct ostream *output;
};
if (changes_during_sync != NULL || changes_during_sync2 != NULL) {
/* don't log a warning when running via doveadm server
(e.g. called by replicator) */
- if (cctx->conn_type == CLIENT_CONNECTION_TYPE_CLI) {
+ if (cctx->conn_type == DOVEADM_CONNECTION_TYPE_CLI) {
i_warning("Mailbox changes caused a desync. "
"You may want to run dsync again: %s",
changes_during_sync == NULL ||
{
struct dsync_cmd_context *ctx = (struct dsync_cmd_context *)_ctx;
struct doveadm_cmd_context *cctx = _ctx->cctx;
- bool cli = (cctx->conn_type == CLIENT_CONNECTION_TYPE_CLI);
+ bool cli = (cctx->conn_type == DOVEADM_CONNECTION_TYPE_CLI);
struct dsync_ibc *ibc;
struct dsync_brain *brain;
string_t *temp_prefix, *state_str = NULL;
struct kick_context {
struct who_context who;
HASH_TABLE(void *, struct kick_pid *) pids;
- enum doveadm_client_connection_type conn_type;
+ enum doveadm_client_type conn_type;
bool force_kick;
ARRAY(const char *) kicked_users;
};
{
unsigned int i, count;
const char *const *users;
- bool cli = (ctx->conn_type == CLIENT_CONNECTION_TYPE_CLI);
+ bool cli = (ctx->conn_type == DOVEADM_CONNECTION_TYPE_CLI);
if (array_count(&ctx->kicked_users) == 0) {
if (cli)
return;
}
ctx.conn_type = cctx->conn_type;
- if (ctx.conn_type != CLIENT_CONNECTION_TYPE_CLI) {
+ if (ctx.conn_type != DOVEADM_CONNECTION_TYPE_CLI) {
/* force-kick is a pretty ugly option. its output can't be
nicely translated to an API reply. it also wouldn't be very
useful in scripts, only for preventing a new admin from
void doveadm_mail_get_input(struct doveadm_mail_cmd_context *ctx)
{
const struct doveadm_cmd_context *cctx = ctx->cctx;
- bool cli = (cctx->conn_type == CLIENT_CONNECTION_TYPE_CLI);
+ bool cli = (cctx->conn_type == DOVEADM_CONNECTION_TYPE_CLI);
struct istream *inputs[2];
if (ctx->cmd_input != NULL)
const char *wildcard_user)
{
const struct doveadm_cmd_context *cctx = ctx->cctx;
- bool cli = (cctx->conn_type == CLIENT_CONNECTION_TYPE_CLI);
+ bool cli = (cctx->conn_type == DOVEADM_CONNECTION_TYPE_CLI);
int ret;
const char *error;
int c;
i_zero(&cctx);
- cctx.conn_type = CLIENT_CONNECTION_TYPE_CLI;
+ cctx.conn_type = DOVEADM_CONNECTION_TYPE_CLI;
cctx.username = getenv("USER");
ctx = doveadm_mail_cmdline_init(cmd);
const char *fieldstr;
ARRAY_TYPE(const_string) pargv, full_args;
int i;
- bool cli = (cctx->conn_type == CLIENT_CONNECTION_TYPE_CLI);
- bool tcp_server = (cctx->conn_type == CLIENT_CONNECTION_TYPE_TCP);
+ bool cli = (cctx->conn_type == DOVEADM_CONNECTION_TYPE_CLI);
+ bool tcp_server = (cctx->conn_type == DOVEADM_CONNECTION_TYPE_TCP);
struct doveadm_mail_cmd mail_cmd = {
cctx->cmd->mail_cmd, cctx->cmd->name, cctx->cmd->usage
};
int c;
i_zero(&cctx);
- cctx.conn_type = CLIENT_CONNECTION_TYPE_CLI;
+ cctx.conn_type = DOVEADM_CONNECTION_TYPE_CLI;
i_set_failure_exit_callback(failure_exit_callback);
doveadm_dsync_main(&argc, &argv);
#define DOVEADM_EX_NOTPOSSIBLE EX_DATAERR
#define DOVEADM_EX_UNKNOWN -1
-enum doveadm_client_connection_type {
- CLIENT_CONNECTION_TYPE_CLI = 0,
- CLIENT_CONNECTION_TYPE_TCP,
- CLIENT_CONNECTION_TYPE_HTTP,
+enum doveadm_client_type {
+ DOVEADM_CONNECTION_TYPE_CLI = 0,
+ DOVEADM_CONNECTION_TYPE_TCP,
+ DOVEADM_CONNECTION_TYPE_HTTP,
};
#include "doveadm-cmd.h"
{
struct mcp_cmd_context *ctx =
(struct mcp_cmd_context *)_ctx;
- bool cli = (_ctx->cctx->conn_type == CLIENT_CONNECTION_TYPE_CLI);
+ bool cli = (_ctx->cctx->conn_type == DOVEADM_CONNECTION_TYPE_CLI);
struct raw_key {
const char *attr;