/*
This file is part of GNUnet.
- (C) 2011-2015 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2011-2015 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
#include "platform.h"
#include "gnunet-service-ats_addresses.h"
#include "gnunet-service-ats_performance.h"
+#include "gnunet-service-ats_normalization.h"
#include "gnunet-service-ats_plugins.h"
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;
}
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,
GNUNET_BANDWIDTH_value_init (aa->assigned_bw_out),
GNUNET_BANDWIDTH_value_init (aa->assigned_bw_in));
- GAS_plugin_update_address (aa,
- atsi,
- atsi_count);
+ GAS_normalization_update_property (aa,
+ atsi,
+ atsi_count);
}
GNUNET_free_non_null (atsi_delta);
}
{
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,