diff options
author | Thomas Adam <thomas@xteddy.org> | 2017-05-29 22:01:15 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2017-05-29 22:01:15 +0100 |
commit | 5ee6dc21201323fd1954c618311b233af8273543 (patch) | |
tree | cfb58617f7cfbb74541763efded4da626c5c030d /server-client.c | |
parent | 5bc5fe5e7e137a1644be6312778dc055f8040399 (diff) | |
parent | 8a214b2f8e57be9b55c091ebc707a05a176f3eaa (diff) | |
download | rtmux-5ee6dc21201323fd1954c618311b233af8273543.tar.gz rtmux-5ee6dc21201323fd1954c618311b233af8273543.tar.bz2 rtmux-5ee6dc21201323fd1954c618311b233af8273543.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'server-client.c')
-rw-r--r-- | server-client.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/server-client.c b/server-client.c index e6761e30..18371bd4 100644 --- a/server-client.c +++ b/server-client.c @@ -47,6 +47,21 @@ static void server_client_dispatch_command(struct client *, struct imsg *); static void server_client_dispatch_identify(struct client *, struct imsg *); static void server_client_dispatch_shell(struct client *); +/* Number of attached clients. */ +u_int +server_client_how_many(void) +{ + struct client *c; + u_int n; + + n = 0; + TAILQ_FOREACH(c, &clients, entry) { + if (c->session != NULL && (~c->flags & CLIENT_DETACHING)) + n++; + } + return (n); +} + /* Identify mode callback. */ static void server_client_callback_identify(__unused int fd, __unused short events, |