summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
authornicm <nicm>2019-12-26 11:04:58 +0000
committernicm <nicm>2019-12-26 11:04:58 +0000
commit817d199cbb6720f1848452824f7b93cdc1a24111 (patch)
tree866b45b06c79693e7eec231dad283a81ae3cd574 /session.c
parent07e37479c214023f5d0107414a6e5f414d37197a (diff)
Add a number of new formats to inspect what sessions and clients a
window is present or active in. From Tyler Culp in GitHub issue 2034.
Diffstat (limited to 'session.c')
-rw-r--r--session.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/session.c b/session.c
index b1f49e41..be9c8e07 100644
--- a/session.c
+++ b/session.c
@@ -569,7 +569,20 @@ session_group_count(struct session_group *sg)
n = 0;
TAILQ_FOREACH(s, &sg->sessions, gentry)
- n++;
+ n++;
+ return (n);
+}
+
+/* Count number of clients attached to sessions in session group. */
+u_int
+session_group_attached_count(struct session_group *sg)
+{
+ struct session *s;
+ u_int n;
+
+ n = 0;
+ TAILQ_FOREACH(s, &sg->sessions, gentry)
+ n += s->attached;
return (n);
}