mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-23 06:41:32 +02:00
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.
This commit is contained in:
parent
d9e26a7dd5
commit
af7ea814f9
@ -3060,12 +3060,7 @@ static int stats_process_http_post(struct stream_interface *si)
|
|||||||
break;
|
break;
|
||||||
case ST_ADM_ACTION_SHUTDOWN:
|
case ST_ADM_ACTION_SHUTDOWN:
|
||||||
if (px->state != PR_STSTOPPED) {
|
if (px->state != PR_STSTOPPED) {
|
||||||
struct stream *sess, *sess_bck;
|
srv_shutdown_streams(sv, SF_ERR_KILLED);
|
||||||
|
|
||||||
list_for_each_entry_safe(sess, sess_bck, &sv->actconns, by_srv)
|
|
||||||
if (sess->srv_conn == sv)
|
|
||||||
stream_shutdown(sess, SF_ERR_KILLED);
|
|
||||||
|
|
||||||
altered_servers++;
|
altered_servers++;
|
||||||
total_servers++;
|
total_servers++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user