mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-10 19:12:50 +02:00
REORG: cli: move "shutdown sessions server" to stream.c
It could be argued that it's between server, stream and session but at least due to the fact that it operates on streams, its best place is in stream.c.
This commit is contained in:
22
src/cli.c
22
src/cli.c
@@ -881,28 +881,6 @@ static int stats_sock_parse_request(struct stream_interface *si, char *line)
|
||||
stream_shutdown(sess, SF_ERR_KILLED);
|
||||
return 1;
|
||||
}
|
||||
else if (strcmp(args[1], "sessions") == 0) {
|
||||
if (strcmp(args[2], "server") == 0) {
|
||||
struct server *sv;
|
||||
struct stream *sess, *sess_bck;
|
||||
|
||||
sv = expect_server_admin(s, si, args[3]);
|
||||
if (!sv)
|
||||
return 1;
|
||||
|
||||
/* kill all the stream that are on this server */
|
||||
list_for_each_entry_safe(sess, sess_bck, &sv->actconns, by_srv)
|
||||
if (sess->srv_conn == sv)
|
||||
stream_shutdown(sess, SF_ERR_KILLED);
|
||||
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
appctx->ctx.cli.msg = "'shutdown sessions' only supports 'server'.\n";
|
||||
appctx->st0 = STAT_CLI_PRINT;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else { /* unknown "disable" parameter */
|
||||
appctx->ctx.cli.msg = "'shutdown' only supports 'frontend', 'session' and 'sessions'.\n";
|
||||
appctx->st0 = STAT_CLI_PRINT;
|
||||
|
||||
Reference in New Issue
Block a user