user->to_move = timeout_add(DIRECTOR_USER_MOVE_TIMEOUT_MSECS,
director_user_move_timeout, user);
user->kill_state = USER_KILL_STATE_KILLING;
- cmd = t_strdup_printf("proxy\t*\tKILL-DIRECTOR-HASH\t%u",
+ cmd = t_strdup_printf("proxy\t*\tKICK-DIRECTOR-HASH\t%u",
username_hash);
ipc_client_cmd(dir->ipc_proxy, cmd,
director_kill_user_callback, ctx);
ipc_client_deinit(&ctx->ipc);
}
-static void cmd_proxy_kill_callback(enum ipc_client_cmd_state state,
+static void cmd_proxy_kick_callback(enum ipc_client_cmd_state state,
const char *data, void *context ATTR_UNUSED)
{
switch (state) {
case IPC_CLIENT_CMD_STATE_REPLY:
return;
case IPC_CLIENT_CMD_STATE_OK:
- printf("%s connections killed\n", data);
+ printf("%s connections kicked\n", data);
break;
case IPC_CLIENT_CMD_STATE_ERROR:
- i_error("KILL failed: %s", data);
+ i_error("KICK failed: %s", data);
break;
}
io_loop_stop(current_ioloop);
}
-static void cmd_proxy_kill(int argc, char *argv[])
+static void cmd_proxy_kick(int argc, char *argv[])
{
struct proxy_context *ctx;
- ctx = cmd_proxy_init(argc, argv, "a:", cmd_proxy_kill);
+ ctx = cmd_proxy_init(argc, argv, "a:", cmd_proxy_kick);
if (argv[optind] == NULL) {
- proxy_cmd_help(cmd_proxy_kill);
+ proxy_cmd_help(cmd_proxy_kick);
return;
}
- ipc_client_cmd(ctx->ipc, t_strdup_printf("proxy\t*\tKILL\t%s", argv[optind]),
- cmd_proxy_kill_callback, NULL);
+ ipc_client_cmd(ctx->ipc, t_strdup_printf("proxy\t*\tKICK\t%s", argv[optind]),
+ cmd_proxy_kick_callback, NULL);
io_loop_run(current_ioloop);
ipc_client_deinit(&ctx->ipc);
}
struct doveadm_cmd doveadm_cmd_proxy[] = {
{ cmd_proxy_list, "proxy list",
"[-a <ipc socket path>]" },
- { cmd_proxy_kill, "proxy kill",
+ { cmd_proxy_kick, "proxy kick",
"[-a <ipc socket path>] <user>" }
};
}
static void
-login_proxy_cmd_kill(struct ipc_cmd *cmd, const char *const *args)
+login_proxy_cmd_kick(struct ipc_cmd *cmd, const char *const *args)
{
struct login_proxy *proxy, *next;
unsigned int count = 0;
next = proxy->next;
if (strcmp(proxy->client->virtual_user, args[0]) == 0) {
- client_destroy(proxy->client, "Connection killed");
+ client_destroy(proxy->client, "Connection kicked");
count++;
}
}
}
static void
-login_proxy_cmd_kill_director_hash(struct ipc_cmd *cmd, const char *const *args)
+login_proxy_cmd_kick_director_hash(struct ipc_cmd *cmd, const char *const *args)
{
struct login_proxy *proxy, *next;
unsigned int hash, count = 0;
next = proxy->next;
if (director_username_hash(proxy->client->virtual_user) == hash) {
- client_destroy(proxy->client, "Connection killed");
+ client_destroy(proxy->client, "Connection kicked");
count++;
}
}
const char *name = args[0];
args++;
- if (strcmp(name, "KILL") == 0)
- login_proxy_cmd_kill(cmd, args);
- else if (strcmp(name, "KILL-DIRECTOR-HASH") == 0)
- login_proxy_cmd_kill_director_hash(cmd, args);
+ if (strcmp(name, "KICK") == 0)
+ login_proxy_cmd_kick(cmd, args);
+ else if (strcmp(name, "KICK-DIRECTOR-HASH") == 0)
+ login_proxy_cmd_kick_director_hash(cmd, args);
else if (strcmp(name, "LIST") == 0)
login_proxy_cmd_list(cmd, args);
else