commit 7e5583d5334f7241686dad86a2110d7d6a7ecfc2
parent 6778df25761e1dd63cea97c27ae713079e061f1d
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 28 Feb 2015 18:44:18 +0000
notify monitor about existing connections
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/util/server.c b/src/util/server.c
@@ -1416,6 +1416,7 @@ GNUNET_SERVER_connect_notify (struct GNUNET_SERVER_Handle *server,
void *callback_cls)
{
struct NotifyList *n;
+ struct GNUNET_SERVER_Client *client;
n = GNUNET_new (struct NotifyList);
n->callback = callback;
@@ -1423,6 +1424,8 @@ GNUNET_SERVER_connect_notify (struct GNUNET_SERVER_Handle *server,
GNUNET_CONTAINER_DLL_insert (server->connect_notify_list_head,
server->connect_notify_list_tail,
n);
+ for (client = server->clients_head; NULL != client; client = client->next)
+ callback (callback_cls, client);
}
@@ -1435,8 +1438,8 @@ GNUNET_SERVER_connect_notify (struct GNUNET_SERVER_Handle *server,
*/
void
GNUNET_SERVER_disconnect_notify_cancel (struct GNUNET_SERVER_Handle *server,
- GNUNET_SERVER_DisconnectCallback
- callback, void *callback_cls)
+ GNUNET_SERVER_DisconnectCallback callback,
+ void *callback_cls)
{
struct NotifyList *pos;