-fix compiler warning: do not return const double
[oweals/gnunet.git] / src / ats / gnunet-service-ats.c
index e9a11a8b8174110ecdc809dd935fadb89b8677cc..68be19ba59202577f6907c3b319d27212d6b8258 100644 (file)
@@ -41,6 +41,7 @@ struct GNUNET_STATISTICS_Handle *GSA_stats;
 
 static struct GNUNET_SERVER_Handle *GSA_server;
 
+struct GAS_Addresses_Handle *GSA_addresses;
 
 /**
  * We have received a 'ClientStartMessage' from a client.  Find out which
@@ -109,7 +110,7 @@ client_disconnect_handler (void *cls, struct GNUNET_SERVER_Client *client)
 static void
 cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  GAS_addresses_done ();
+  GAS_addresses_done (GSA_addresses);
   GAS_scheduling_done ();
   GAS_performance_done ();
   GAS_reservations_done ();
@@ -158,6 +159,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
      sizeof (struct ReservationRequestMessage)},
     {&GAS_handle_preference_change, NULL,
      GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_CHANGE, 0},
+    {&GAS_handle_preference_feedback, NULL,
+     GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_FEEDBACK, 0},
     {&GAS_handle_reset_backoff, NULL,
      GNUNET_MESSAGE_TYPE_ATS_RESET_BACKOFF,
      sizeof (struct ResetBackoffMessage)},
@@ -166,9 +169,10 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
   GSA_server = server;
   GSA_stats = GNUNET_STATISTICS_create ("ats", cfg);
   GAS_reservations_init ();
-  GAS_performance_init (server);
-  GAS_scheduling_init (server);
-  GAS_addresses_init (cfg, GSA_stats);
+  GSA_addresses = GAS_addresses_init (cfg, GSA_stats);
+  GAS_performance_init (server, GSA_addresses);
+  GAS_scheduling_init (server, GSA_addresses);
+
   GNUNET_SERVER_disconnect_notify (server, &client_disconnect_handler, NULL);
   GNUNET_SERVER_add_handlers (server, handlers);
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup_task,