aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_ats.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/gnunet-service-transport_ats.c')
-rw-r--r--src/transport/gnunet-service-transport_ats.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/transport/gnunet-service-transport_ats.c b/src/transport/gnunet-service-transport_ats.c
index 619cc145b..8eb829875 100644
--- a/src/transport/gnunet-service-transport_ats.c
+++ b/src/transport/gnunet-service-transport_ats.c
@@ -546,12 +546,17 @@ GST_ats_new_session (const struct GNUNET_HELLO_Address *address,
546 * Release memory used by the given address data. 546 * Release memory used by the given address data.
547 * 547 *
548 * @param ai the `struct AddressInfo` 548 * @param ai the `struct AddressInfo`
549 */ 549 */
550static void 550static void
551destroy_ai (struct AddressInfo *ai) 551destroy_ai (struct AddressInfo *ai)
552{ 552{
553 GNUNET_assert (NULL == ai->session); 553 GNUNET_assert (NULL == ai->session);
554 GNUNET_assert (NULL == ai->unblock_task); 554 if (NULL != ai->unblock_task)
555 {
556 GNUNET_SCHEDULER_cancel (ai->unblock_task);
557 ai->unblock_task = NULL;
558 num_blocked--;
559 }
555 GNUNET_assert (GNUNET_YES == 560 GNUNET_assert (GNUNET_YES ==
556 GNUNET_CONTAINER_multipeermap_remove (p2a, 561 GNUNET_CONTAINER_multipeermap_remove (p2a,
557 &ai->address->peer, 562 &ai->address->peer,
@@ -608,7 +613,7 @@ GST_ats_del_session (const struct GNUNET_HELLO_Address *address,
608 "Telling ATS to destroy session %p from peer %s\n", 613 "Telling ATS to destroy session %p from peer %s\n",
609 session, 614 session,
610 GNUNET_i2s (&address->peer)); 615 GNUNET_i2s (&address->peer));
611 if (GNUNET_YES == ai->expired) 616 if (GNUNET_YES == ai->expired)
612 { 617 {
613 /* last reason to keep this 'ai' around is now gone, the 618 /* last reason to keep this 'ai' around is now gone, the
614 session is dead as well, clean up */ 619 session is dead as well, clean up */
@@ -758,12 +763,6 @@ GST_ats_expire_address (const struct GNUNET_HELLO_Address *address)
758 GNUNET_assert (0); 763 GNUNET_assert (0);
759 return; 764 return;
760 } 765 }
761 if (NULL != ai->unblock_task)
762 {
763 GNUNET_SCHEDULER_cancel (ai->unblock_task);
764 ai->unblock_task = NULL;
765 num_blocked--;
766 }
767 if (NULL != ai->session) 766 if (NULL != ai->session)
768 { 767 {
769 ai->expired = GNUNET_YES; 768 ai->expired = GNUNET_YES;
@@ -798,12 +797,6 @@ destroy_ai_cb (void *cls,
798{ 797{
799 struct AddressInfo *ai = value; 798 struct AddressInfo *ai = value;
800 799
801 if (NULL != ai->unblock_task)
802 {
803 GNUNET_SCHEDULER_cancel (ai->unblock_task);
804 ai->unblock_task = NULL;
805 num_blocked--;
806 }
807 destroy_ai (ai); 800 destroy_ai (ai);
808 return GNUNET_OK; 801 return GNUNET_OK;
809} 802}