summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2014-08-22 14:35:15 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2014-08-22 14:35:15 +0000
commitd2fcf66a3f5b1b45b64ce039b5b604d157866e7f (patch)
tree875ced22f06552fd2fff0b8b56409936b09ac485 /src
parent32238c161b4b2bc0980caf69340da9f9d3042ab5 (diff)
Teardown DHT connection after clearing up the ActiveContext
Diffstat (limited to 'src')
-rw-r--r--src/dht/gnunet_dht_profiler.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/dht/gnunet_dht_profiler.c b/src/dht/gnunet_dht_profiler.c
index a9c84b723..b95239f32 100644
--- a/src/dht/gnunet_dht_profiler.c
+++ b/src/dht/gnunet_dht_profiler.c
@@ -385,21 +385,23 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
for (cnt=0; cnt < num_peers; cnt++)
{
- if (NULL != a_ctx[cnt].op)
- GNUNET_TESTBED_operation_done (a_ctx[cnt].op); //FIXME: assertion fails.
-
/* Cleanup active context if this peer is an active peer */
ac = a_ctx[cnt].ac;
- if (NULL == ac)
- continue;
- if (GNUNET_SCHEDULER_NO_TASK != ac->delay_task)
- GNUNET_SCHEDULER_cancel (ac->delay_task);
- if (NULL != ac->put_data)
- GNUNET_free (ac->put_data);
- if (NULL != ac->dht_put)
- GNUNET_DHT_put_cancel (ac->dht_put);
- if (NULL != ac->dht_get)
- GNUNET_DHT_get_stop (ac->dht_get);
+ if (NULL != ac)
+ {
+ if (GNUNET_SCHEDULER_NO_TASK != ac->delay_task)
+ GNUNET_SCHEDULER_cancel (ac->delay_task);
+ if (NULL != ac->put_data)
+ GNUNET_free (ac->put_data);
+ if (NULL != ac->dht_put)
+ GNUNET_DHT_put_cancel (ac->dht_put);
+ if (NULL != ac->dht_get)
+ GNUNET_DHT_get_stop (ac->dht_get);
+ }
+ /* Cleanup testbed operation handle at the last as this operation may
+ contain service connection to DHT */
+ if (NULL != a_ctx[cnt].op)
+ GNUNET_TESTBED_operation_done (a_ctx[cnt].op);
}
GNUNET_free (a_ctx);
a_ctx = NULL;