From 438710f03600e93d9b7a9f5387ebb1d7e5a0bb16 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 8 Dec 2013 22:31:04 +0000 Subject: -fix #3168, cancel retry task AFTER GMT_cancel, as that triggers a callback in gnunet-service-mesh-peer.c:952 which may then CREATE a new task --- src/mesh/gnunet-service-mesh_channel.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/mesh/gnunet-service-mesh_channel.c b/src/mesh/gnunet-service-mesh_channel.c index b6305aabe..ba9485fdc 100644 --- a/src/mesh/gnunet-service-mesh_channel.c +++ b/src/mesh/gnunet-service-mesh_channel.c @@ -918,12 +918,13 @@ channel_rel_free_all (struct MeshChannelReliability *rel) LOG (GNUNET_ERROR_TYPE_DEBUG, " COPYFREE BATCH %p\n", copy); GNUNET_free (copy); } + if (NULL != rel->uniq && NULL != rel->uniq->q) + GMT_cancel (rel->uniq->q); if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task) { GNUNET_SCHEDULER_cancel (rel->retry_task); + rel->retry_task = GNUNET_SCHEDULER_NO_TASK; } - if (NULL != rel->uniq && NULL != rel->uniq->q) - GMT_cancel (rel->uniq->q); GNUNET_free (rel); } @@ -1965,6 +1966,7 @@ GMCH_handle_data_ack (struct MeshChannel *ch, if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task) { GNUNET_SCHEDULER_cancel (rel->retry_task); + rel->retry_task = GNUNET_SCHEDULER_NO_TASK; if (NULL != rel->head_sent && NULL == rel->head_sent->q) { struct GNUNET_TIME_Absolute new_target; @@ -1980,10 +1982,6 @@ GMCH_handle_data_ack (struct MeshChannel *ch, &channel_retransmit_message, rel); } - else /* either no more traffic to ack or traffic has just been queued */ - { - rel->retry_task = GNUNET_SCHEDULER_NO_TASK; - } } else /* work was done but no task was pending? shouldn't happen! */ { -- cgit v1.2.3