-ensure stats queues do not grow too big
[oweals/gnunet.git] / src / multicast / gnunet-service-multicast.c
index 8041119b0716d6170711de7c417ab566a1c1fdae..94f9d2f88e8ce276430f830747feffae267cc7b8 100644 (file)
@@ -447,6 +447,7 @@ replay_req_remove_cadet (struct Channel *chn)
     if (c == chn)
     {
       GNUNET_CONTAINER_multihashmap_remove (grp_replay_req, &key, chn);
+      GNUNET_CONTAINER_multihashmap_iterator_destroy (it);
       return GNUNET_YES;
     }
   }
@@ -484,6 +485,7 @@ replay_req_remove_client (struct Group *grp, struct GNUNET_SERVER_Client *client
     if (c == client)
     {
       GNUNET_CONTAINER_multihashmap_remove (replay_req_client, &key, client);
+      GNUNET_CONTAINER_multihashmap_iterator_destroy (it);
       return GNUNET_YES;
     }
   }
@@ -759,7 +761,7 @@ cadet_send_channel (struct Channel *chn, const struct GNUNET_MessageHeader *msg)
                                           GNUNET_TIME_UNIT_FOREVER_REL,
                                           ntohs (msg->size),
                                           &cadet_notify_transmit_ready,
-                                          (void *) msg);
+                                          tcls);
   GNUNET_assert (NULL != chn->tmit_handle);
 }
 
@@ -1837,10 +1839,10 @@ core_connected_cb  (void *cls, const struct GNUNET_PeerIdentity *my_identity)
 
   nc = GNUNET_SERVER_notification_context_create (server, 1);
   GNUNET_SERVER_add_handlers (server, server_handlers);
-  GNUNET_SERVER_disconnect_notify (server, &client_notify_disconnect, NULL);
-
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
-                                NULL);
+  GNUNET_SERVER_disconnect_notify (server,
+                                  &client_notify_disconnect, NULL);
+  GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+                                NULL);
 }
 
 
@@ -1852,7 +1854,8 @@ core_connected_cb  (void *cls, const struct GNUNET_PeerIdentity *my_identity)
  * @param cfg configuration to use
  */
 static void
-run (void *cls, struct GNUNET_SERVER_Handle *srv,
+run (void *cls,
+     struct GNUNET_SERVER_Handle *srv,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
   cfg = c;