line
[oweals/gnunet.git] / src / statistics / gnunet-service-statistics.c
index 823dc419ee0604cc73ad284fa20e75e36fb764aa..c506dee7b9aa44408be58b387a12f0a617da195a 100644 (file)
@@ -329,8 +329,7 @@ make_client_entry (struct GNUNET_SERVER_Client *client)
 {
   struct ClientEntry *ce;
 
-  if (client == NULL)
-    return NULL;
+  GNUNET_assert (client != NULL);
   ce = client_head;
   while (ce != NULL)
     {
@@ -370,7 +369,8 @@ handle_get (void *cls,
   struct StatsEntry *pos;
   size_t size;
 
-  make_client_entry (client);
+  if (client != NULL)
+    make_client_entry (client);
   size = ntohs (message->size) - sizeof (struct GNUNET_MessageHeader);
   if (size != GNUNET_STRINGS_buffer_tokenize ((const char *) &message[1],
                                               size, 2, &service, &name))
@@ -453,7 +453,8 @@ handle_set (void *cls,
   int64_t delta;
   int changed;
 
-  make_client_entry (client);
+  if (client != NULL)
+    make_client_entry (client);
   msize = ntohs (message->size);
   if (msize < sizeof (struct GNUNET_STATISTICS_SetMessage))
     {
@@ -729,13 +730,11 @@ handle_client_disconnect (void *cls,
  * Process statistics requests.
  *
  * @param cls closure
- * @param sched scheduler to use
  * @param server the initialized server
  * @param c configuration to use
  */
 static void
 run (void *cls,
-     struct GNUNET_SCHEDULER_Handle *sched,
      struct GNUNET_SERVER_Handle *server,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
@@ -752,8 +751,7 @@ run (void *cls,
                                   &handle_client_disconnect,
                                   NULL);
   load (server);
-  GNUNET_SCHEDULER_add_delayed (sched,
-                               GNUNET_TIME_UNIT_FOREVER_REL,
+  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
                                &shutdown_task,
                                NULL);
 }