From: Matthias Wachs Date: Tue, 8 Nov 2011 09:27:25 +0000 (+0000) Subject: transport notifies about addresses in use X-Git-Tag: initial-import-from-subversion-38251~16008 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ddf009c6d6b00878994e53af4cdc65ce6a2a61fa;p=oweals%2Fgnunet.git transport notifies about addresses in use --- diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index e7d458e7f..e6b298f4f 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c @@ -1148,6 +1148,9 @@ send_switch_address_continuation (void *cls, GNUNET_ATS_suggest_address (GST_ats, &n->id); return; } + /* Tell ATS that switching addresses was successful */ + GNUNET_ATS_address_in_use (GST_ats, &n->id, n->plugin_name, n->addr, + n->addrlen, n->addr, GNUNET_YES); } /** @@ -1314,6 +1317,14 @@ GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer, n->addr, n->addrlen, GNUNET_NO); + /* This will be a connection switch, tell ATS about it */ + if (n->state == S_CONNECTED) + { + GNUNET_ATS_address_in_use (GST_ats, &n->id, n->plugin_name, n->addr, + n->addrlen, n->addr, GNUNET_NO); + } + + /* set new address */ GNUNET_free_non_null (n->addr); n->addr = GNUNET_malloc (address_len); memcpy (n->addr, address, address_len);