-fix config, shutdown issue
[oweals/gnunet.git] / src / ats / gnunet-service-ats_addresses.c
index 6c40c6fc8217efec2c6e2c79a62e8f22a69616c9..a1d47e3b94a7e3da9bcbb3fe37442ad07a0efadb 100644 (file)
@@ -412,6 +412,7 @@ create_address (const struct GNUNET_PeerIdentity *peer,
   for (c1 = 0; c1 < GNUNET_ATS_QualityPropertiesCount; c1++)
   {
     aa->atsin[c1].avg_queue_index = 0;
+    aa->atsin[c1].norm = DEFAULT_REL_QUALITY;
     for (c2 = 0; c2 < GAS_normalization_queue_length; c2++)
       aa->atsin[c1].atsi_abs[c2] = GNUNET_ATS_VALUE_UNDEFINED;
   }
@@ -645,7 +646,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);
   }
@@ -725,6 +726,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,