From af7ea814f9e041a97a9a42992d5980db351f2241 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 14 Nov 2019 16:42:04 +0100 Subject: [PATCH] CLEANUP: stats: use srv_shutdown_streams() instead of open-coding it The "shutdown sessions" admin-mode command used to open-code the list traversal while there's already a function for this: srv_shutdown_streams(). Better use it. --- src/stats.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/stats.c b/src/stats.c index 7ebf2e567c..cf692dafda 100644 --- a/src/stats.c +++ b/src/stats.c @@ -3060,12 +3060,7 @@ static int stats_process_http_post(struct stream_interface *si) break; case ST_ADM_ACTION_SHUTDOWN: if (px->state != PR_STSTOPPED) { - struct stream *sess, *sess_bck; - - list_for_each_entry_safe(sess, sess_bck, &sv->actconns, by_srv) - if (sess->srv_conn == sv) - stream_shutdown(sess, SF_ERR_KILLED); - + srv_shutdown_streams(sv, SF_ERR_KILLED); altered_servers++; total_servers++; }