-fix config, shutdown issue
[oweals/gnunet.git] / src / ats / test_ats_api_scheduling_destroy_address.c
index 323128ac261e179402f9627ab86e1174e9afc155..23321b83bb9a2ca25e0c3d0755a86b19792b4793 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2010,2011 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2010,2011 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -45,6 +45,11 @@ static struct GNUNET_STATISTICS_Handle *stats;
  */
 static struct GNUNET_ATS_SchedulingHandle *sched_ats;
 
+/**
+ * Our address record.
+ */
+static struct GNUNET_ATS_AddressRecord *ar;
+
 /**
  * Return value
  */
@@ -139,9 +144,8 @@ stat_cb (void *cls, const char *subsystem,
   {
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                 "Statistics observed address added, now destroying address\n");
-    GNUNET_ATS_address_destroyed (sched_ats,
-                                  &test_hello_address,
-                                  test_session);
+    GNUNET_ATS_address_destroy (ar);
+    ar = NULL;
   }
   return GNUNET_OK;
 }
@@ -211,11 +215,11 @@ got_initial_value (void *cls,
   test_hello_address.address_length = test_addr.addr_len;
 
   /* Adding address */
-  GNUNET_ATS_address_add (sched_ats,
-                          &test_hello_address,
-                          test_session,
-                          test_ats_info,
-                          test_ats_count);
+  ar = GNUNET_ATS_address_add (sched_ats,
+                               &test_hello_address,
+                               test_session,
+                               test_ats_info,
+                               test_ats_count);
 }