+ * Release memory used by the given address data.
+ *
+ * @param ai the `struct AddressInfo`
+ */
+static void
+destroy_ai (struct AddressInfo *ai)
+{
+ GNUNET_assert (NULL == ai->session);
+ if (NULL != ai->unblock_task)
+ {
+ GNUNET_SCHEDULER_cancel (ai->unblock_task);
+ ai->unblock_task = NULL;
+ num_blocked--;
+ }
+ GNUNET_assert (GNUNET_YES ==
+ GNUNET_CONTAINER_multipeermap_remove (p2a,
+ &ai->address->peer,
+ ai));
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Telling ATS to destroy address from peer %s\n",
+ GNUNET_i2s (&ai->address->peer));
+ if (NULL != ai->ar)
+ {
+ GNUNET_ATS_address_destroy (ai->ar);
+ ai->ar = NULL;
+ }
+ publish_p2a_stat_update ();
+ GNUNET_HELLO_address_free (ai->address);
+ GNUNET_free (ai);
+}
+
+
+/**
+ * Notify ATS that the @a session (but not the @a address) of
+ * a given @a address is no longer relevant. (The @a session
+ * went down.) This function may be called even if for the
+ * respective outbound address #GST_ats_new_session() was
+ * never called and thus the pair is unknown to ATS. In this
+ * case, the call is simply ignored.