address.address = plugin_address;
address.address_length = plugin_address_length;
address.transport_name = plugin_name;
+
+ if ((s == NULL) && (0 == address.address_length))
+ {
+ GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
+ "ATS returned invalid address for peer `%s' transport `%s' address length %i, session_id %i\n",
+ GNUNET_i2s(&address.peer) , address.transport_name, plugin_address_length, session_id);
+ GNUNET_break_op (0);
+ GNUNET_CLIENT_receive (sh->client, &process_ats_message, sh,
+ GNUNET_TIME_UNIT_FOREVER_REL);
+ return;
+ }
+
sh->suggest_cb (sh->suggest_cb_cls, &address, s, m->bandwidth_out,
m->bandwidth_in, atsi, ats_count);
aa->addr,
aa->addr_len)) )
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Deleting address for peer `%s': `%s'\n",
GNUNET_i2s (&aa->peer), aa->plugin);
if (GNUNET_YES == destroy_address (aa))
GNUNET_break (0 == strcmp (info->plugin, aa->plugin));
/* session died */
aa->session_id = 0;
+
if (GNUNET_YES == aa->active)
{
aa->active = GNUNET_NO;
active_addr_count--;
- if (aa->addr_len == 0)
- (void) destroy_address (aa);
recalculate_assigned_bw ();
}
+
+ /* session == 0 and addrlen == 0 : destroy address */
+ if (aa->addr_len == 0)
+ (void) destroy_address (aa);
+
return GNUNET_OK;
}