-skeletons for transport-ng
[oweals/gnunet.git] / src / ats / gnunet-service-ats_addresses.c
index 1cf8368a28e78b97cc5468d75d79fea64054402c..d8f467688e63ee1115445291f1ca5a999c799e41 100644 (file)
@@ -1,6 +1,6 @@
 /*
  This file is part of GNUnet.
- Copyright (C) 2011-2015 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2011-2015 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
@@ -14,8 +14,8 @@
 
  You should have received a copy of the GNU General Public License
  along with GNUnet; see the file COPYING.  If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
  */
 
 /**
@@ -225,6 +225,7 @@ GAS_addresses_add (const struct GNUNET_PeerIdentity *peer,
     GNUNET_break (0);
     return;
   }
+  GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope);
   new_address = create_address (peer,
                                 plugin_name,
                                 plugin_addr,
@@ -294,7 +295,7 @@ GAS_addresses_update (const struct GNUNET_PeerIdentity *peer,
               "Received ADDRESS_UPDATE for peer `%s' slot %u\n",
               GNUNET_i2s (peer),
               (unsigned int) session_id);
-
+  GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope);
   /* Update address */
   aa->t_last_activity = GNUNET_TIME_absolute_get();
   aa->properties = *prop;
@@ -404,7 +405,9 @@ GAS_addresses_done ()
 {
   GNUNET_log(GNUNET_ERROR_TYPE_INFO,
              "Shutting down addresses\n");
+  GAS_plugin_solver_lock ();
   GAS_addresses_destroy_all ();
+  GAS_plugin_solver_unlock ();
   GNUNET_CONTAINER_multipeermap_destroy (GSA_addresses);
   GSA_addresses = NULL;
 }