-fix config, shutdown issue
[oweals/gnunet.git] / src / ats / test_ats_api_scheduling_destroy_address.c
index a286ab8a4ef8b6cb7827ecb73cc70f30d0342916..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;
 }
@@ -163,9 +167,7 @@ address_suggest_cb (void *cls,
                     const struct GNUNET_HELLO_Address *address,
                     struct Session *session,
                     struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
-                    struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
-                    const struct GNUNET_ATS_Information *atsi,
-                    uint32_t ats_count)
+                    struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
               "Did not expect suggestion callback!\n");
@@ -213,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);
 }