-ensure stats queues do not grow too big
[oweals/gnunet.git] / src / gns / gnunet-service-gns.c
index 7c8713b68dfdf507399aa3f758082a846fcaf028..e2bb0ad8c4f658fae2e78aa1bd54b8aa49986fac 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2011-2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2011-2013 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 /**
  * @file gns/gnunet-service-gns.c
@@ -260,8 +260,7 @@ static struct GNUNET_STATISTICS_Handle *statistics;
  * @param tc unused
  */
 static void
-shutdown_task (void *cls,
-               const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
 {
   struct ClientLookupHandle *clh;
   struct MonitorActivity *ma;
@@ -349,11 +348,9 @@ shutdown_task (void *cls,
  * Method called periodically that triggers iteration over authoritative records
  *
  * @param cls closure
- * @param tc task context
  */
 static void
-publish_zone_dht_next (void *cls,
-                       const struct GNUNET_SCHEDULER_TaskContext *tc)
+publish_zone_dht_next (void *cls)
 {
   zone_publish_task = NULL;
   GNUNET_NAMESTORE_zone_iterator_next (namestore_iter);
@@ -364,11 +361,9 @@ publish_zone_dht_next (void *cls,
  * Periodically iterate over our zone and store everything in dht
  *
  * @param cls NULL
- * @param tc task context
  */
 static void
-publish_zone_dht_start (void *cls,
-                       const struct GNUNET_SCHEDULER_TaskContext *tc);
+publish_zone_dht_start (void *cls);
 
 
 /**
@@ -515,7 +510,6 @@ perform_dht_put (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
                         block_size,
                         block,
                         expire,
-                        DHT_OPERATION_TIMEOUT,
                         &dht_put_continuation,
                         pc_arg);
   GNUNET_free (block);
@@ -629,11 +623,9 @@ put_gns_record (void *cls,
  * Periodically iterate over all zones and store everything in DHT
  *
  * @param cls NULL
- * @param tc task context
  */
 static void
-publish_zone_dht_start (void *cls,
-                       const struct GNUNET_SCHEDULER_TaskContext *tc)
+publish_zone_dht_start (void *cls)
 {
   zone_publish_task = NULL;
 
@@ -714,9 +706,8 @@ send_lookup_response (void* cls,
   size_t len;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Sending `%s' message with %d results\n",
-              "LOOKUP_RESULT",
-             rd_count);
+             "Sending LOOKUP_RESULT message with %u results\n",
+             (unsigned int) rd_count);
 
   len = GNUNET_GNSRECORD_records_get_size (rd_count, rd);
   rmsg = GNUNET_malloc (len + sizeof (struct GNUNET_GNS_ClientLookupResultMessage));
@@ -765,8 +756,7 @@ handle_lookup (void *cls,
   const struct GNUNET_GNS_ClientLookupMessage *sh_msg;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Received `%s' message\n",
-             "LOOKUP");
+             "Received LOOKUP message\n");
   msg_size = ntohs (message->size);
   if (msg_size < sizeof (struct GNUNET_GNS_ClientLookupMessage))
   {
@@ -1017,8 +1007,7 @@ run (void *cls,
                                               &monitor_sync_event,
                                               NULL);
   GNUNET_break (NULL != zmon);
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
-                               &shutdown_task, NULL);
+  GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL);
 }