-improve UDP logging
[oweals/gnunet.git] / src / ats / gnunet-service-ats_addresses.c
index 0a35570c763fc8c504f439fe4e521f1888e683ca..c4d7f2da9737239cd898c2af3aada1c7db943347 100644 (file)
@@ -572,10 +572,13 @@ GAS_addresses_add (const struct GNUNET_PeerIdentity *peer,
              GNUNET_i2s (peer),
              session_id);
   /* Tell solver about new address */
+  GAS_plugin_solver_lock ();
   GAS_plugin_new_address (new_address,
-                         addr_net,
-                         atsi,
-                         atsi_count);
+                         addr_net);
+  GAS_normalization_update_property (new_address,
+                                     atsi,
+                                     atsi_count);
+  GAS_plugin_solver_unlock ();
   /* Notify performance clients about new address */
   GAS_performance_notify_all_clients (&new_address->peer,
                                      new_address->plugin,
@@ -646,7 +649,7 @@ GAS_addresses_update (const struct GNUNET_PeerIdentity *peer,
                                        GNUNET_BANDWIDTH_value_init (aa->assigned_bw_out),
                                        GNUNET_BANDWIDTH_value_init (aa->assigned_bw_in));
 
-    GAS_normalization_normalize_property (aa,
+    GAS_normalization_update_property (aa,
                                           atsi,
                                           atsi_count);
   }
@@ -726,6 +729,9 @@ GAS_addresses_destroy_all ()
 {
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Destroying all addresses\n");
+  if (0 ==
+      GNUNET_CONTAINER_multipeermap_size (GSA_addresses))
+    return;
   GAS_plugin_solver_lock ();
   GNUNET_CONTAINER_multipeermap_iterate (GSA_addresses,
                                          &destroy_all_address_it,