From: Matthias Wachs Date: Fri, 14 Oct 2011 14:15:12 +0000 (+0000) Subject: no merging just replacing X-Git-Tag: initial-import-from-subversion-38251~16510 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1b03c4df12ae33861b28af20979e530ecb914fed;p=oweals%2Fgnunet.git no merging just replacing --- diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index e874ca7c4..5ed3c471b 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c @@ -111,37 +111,6 @@ find_address (const struct GNUNET_PeerIdentity *peer, return cac.result; } -static void -merge_ats (struct ATS_Address * dest, struct ATS_Address * source) -{ - /* - int c_src = 0; - int c_dest = 0; - struct GNUNET_TRANSPORT_ATS_Information * a_src = source->ats; - struct GNUNET_TRANSPORT_ATS_Information * a_dest = dest->ats; - struct ATS_Address * bigger = NULL; - - bigger = (dest->ats_count > source->ats_count) ? dest : source; - int new_entries = bigger->ats_count; - - if (new_entries == 0) - return; - - for (c_dest = 0; c_dest < dest->ats_count; c_dest ++) - { - for (c_src = 0; c_src < source->ats_count; c_src ++) - { - if (a_src[c_src].type == a_dest[c_dest].type) - new_entries--; - } - } - - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Have %u entries to update and %u new entries\n",bigger->ats_count, - new_entries); - */ -} - void GAS_address_update (const struct GNUNET_PeerIdentity *peer, const char *plugin_name, @@ -181,11 +150,16 @@ GAS_address_update (const struct GNUNET_PeerIdentity *peer, } else { - merge_ats (old, aa); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Updated existing address for peer `%s' %X \n", GNUNET_i2s (peer), old); - destroy_address (aa); + GNUNET_free_non_null(old->ats); + old->ats = NULL; + old->ats_count = 0; + old->ats = aa->ats; + old->ats_count = aa->ats_count; + GNUNET_free (aa->plugin); + GNUNET_free (aa); } } diff --git a/src/ats/test_ats_api.conf b/src/ats/test_ats_api.conf index de539981b..79e92af49 100644 --- a/src/ats/test_ats_api.conf +++ b/src/ats/test_ats_api.conf @@ -8,7 +8,7 @@ UNIXPATH = /tmp/test-ats-scheduling-arm.sock [ats] DEBUG = YES -PREFIX = valgrind --leak-check=full +#PREFIX = valgrind --leak-check=full AUTOSTART = YES PORT = 12002 HOSTNAME = localhost