-patch from #1972 to display disconnects instead of exiting
[oweals/gnunet.git] / src / ats / gnunet-service-ats.c
index ec374aef8e1aa9ce9da6615a6f3902ab851c6404..7deca0b62320d8e85a71116ebe127da32c0e0c9a 100644 (file)
@@ -43,6 +43,7 @@ struct GNUNET_STATISTICS_Handle *GSA_stats;
  * We have received a 'ClientStartMessage' from a client.  Find out which
  * type of client it is and notify the respective subsystem.
  *
+ * @param cls closure, unused
  * @param client handle to the client
  * @param message the start message
  */
@@ -113,7 +114,7 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   if (NULL != GSA_stats)
   {
     GNUNET_STATISTICS_destroy (GSA_stats, GNUNET_NO);
-    GSA_stats = 0;
+    GSA_stats = NULL;
   }
 }
 
@@ -135,6 +136,9 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
     {&GAS_handle_request_address, NULL,
      GNUNET_MESSAGE_TYPE_ATS_REQUEST_ADDRESS,
      sizeof (struct RequestAddressMessage)},
+    {&GAS_handle_request_address_cancel, NULL,
+     GNUNET_MESSAGE_TYPE_ATS_REQUEST_ADDRESS_CANCEL,
+     sizeof (struct RequestAddressMessage)},
     {&GAS_handle_address_update, NULL,
      GNUNET_MESSAGE_TYPE_ATS_ADDRESS_UPDATE, 0},
     {&GAS_handle_address_in_use, NULL,
@@ -152,7 +156,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
   GAS_reservations_init ();
   GAS_performance_init (server);
   GAS_scheduling_init (server);
-  GAS_addresses_init (cfg);
+  GAS_addresses_init (cfg, GSA_stats);
   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,