Use server_destroy_session() for kill-session.

This commit is contained in:
Nicholas Marriott 2010-06-26 23:55:50 +00:00
parent 42e2413978
commit 34464da8d3
2 changed files with 2 additions and 11 deletions

View File

@ -45,21 +45,11 @@ cmd_kill_session_exec(struct cmd *self, struct cmd_ctx *ctx)
{ {
struct cmd_target_data *data = self->data; struct cmd_target_data *data = self->data;
struct session *s; struct session *s;
struct client *c;
u_int i;
if ((s = cmd_find_session(ctx, data->target)) == NULL) if ((s = cmd_find_session(ctx, data->target)) == NULL)
return (-1); return (-1);
for (i = 0; i < ARRAY_LENGTH(&clients); i++) { server_destroy_session(s);
c = ARRAY_ITEM(&clients, i);
if (c != NULL && c->session == s) {
c->session = NULL;
server_write_client(c, MSG_EXIT, NULL, 0);
}
}
recalculate_sizes();
session_destroy(s); session_destroy(s);
return (0); return (0);

View File

@ -371,6 +371,7 @@ server_destroy_session(struct session *s)
c->session = NULL; c->session = NULL;
server_write_client(c, MSG_EXIT, NULL, 0); server_write_client(c, MSG_EXIT, NULL, 0);
} }
recalculate_sizes();
} }
void void