From ff4676cf541590707a7038cdd8b2e863c69c03a4 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 23 Oct 2014 10:22:19 +0000 Subject: add function to obtain number of subscribers to NC --- src/util/server_nc.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/util') diff --git a/src/util/server_nc.c b/src/util/server_nc.c index 0074ea935..416c71afd 100644 --- a/src/util/server_nc.c +++ b/src/util/server_nc.c @@ -435,4 +435,22 @@ GNUNET_SERVER_notification_context_broadcast (struct } +/** + * Return active number of subscribers in this context. + * + * @param nc context to query + * @return number of current subscribers + */ +unsigned int +GNUNET_SERVER_notification_context_get_size (struct GNUNET_SERVER_NotificationContext *nc) +{ + unsigned int num; + struct ClientList *pos; + + num = 0; + for (pos = nc->clients_head; NULL != pos; pos = pos->next) + num++; + return num; +} + /* end of server_nc.c */ -- cgit v1.2.3