-only trigger check config if we actually need it
[oweals/gnunet.git] / src / ats / gnunet-service-ats.c
index 994a69fdc2c72af913374a1c5cf27b0779f28f0c..045a5bb67307748a0134526874e84a42a8af903f 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2011 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2011 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
@@ -124,12 +124,12 @@ client_disconnect_handler (void *cls,
  * Task run during shutdown.
  *
  * @param cls unused
- * @param tc unused
  */
 static void
-cleanup_task (void *cls,
-              const struct GNUNET_SCHEDULER_TaskContext *tc)
+cleanup_task (void *cls)
 {
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "ATS shutdown initiated\n");
   GAS_connectivity_done ();
   GAS_addresses_done ();
   GAS_plugin_done ();
@@ -138,9 +138,6 @@ cleanup_task (void *cls,
   GAS_performance_done ();
   GAS_preference_done ();
   GAS_reservations_done ();
-  GNUNET_SERVER_disconnect_notify_cancel (GSA_server,
-                                          &client_disconnect_handler,
-                                          NULL);
   if (NULL != GSA_stats)
   {
     GNUNET_STATISTICS_destroy (GSA_stats, GNUNET_NO);
@@ -221,9 +218,8 @@ run (void *cls,
                                    &client_disconnect_handler,
                                   NULL);
   GNUNET_SERVER_add_handlers (server, handlers);
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
-                                &cleanup_task,
-                               NULL);
+  GNUNET_SCHEDULER_add_shutdown (&cleanup_task,
+                                NULL);
 }