diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2014-08-22 14:35:15 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2014-08-22 14:35:15 +0000 |
commit | d2fcf66a3f5b1b45b64ce039b5b604d157866e7f (patch) | |
tree | 875ced22f06552fd2fff0b8b56409936b09ac485 /src/dht | |
parent | 32238c161b4b2bc0980caf69340da9f9d3042ab5 (diff) | |
download | gnunet-d2fcf66a3f5b1b45b64ce039b5b604d157866e7f.tar.gz gnunet-d2fcf66a3f5b1b45b64ce039b5b604d157866e7f.zip |
Teardown DHT connection after clearing up the ActiveContext
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/gnunet_dht_profiler.c | 28 |
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) | |||
385 | { | 385 | { |
386 | for (cnt=0; cnt < num_peers; cnt++) | 386 | for (cnt=0; cnt < num_peers; cnt++) |
387 | { | 387 | { |
388 | if (NULL != a_ctx[cnt].op) | ||
389 | GNUNET_TESTBED_operation_done (a_ctx[cnt].op); //FIXME: assertion fails. | ||
390 | |||
391 | /* Cleanup active context if this peer is an active peer */ | 388 | /* Cleanup active context if this peer is an active peer */ |
392 | ac = a_ctx[cnt].ac; | 389 | ac = a_ctx[cnt].ac; |
393 | if (NULL == ac) | 390 | if (NULL != ac) |
394 | continue; | 391 | { |
395 | if (GNUNET_SCHEDULER_NO_TASK != ac->delay_task) | 392 | if (GNUNET_SCHEDULER_NO_TASK != ac->delay_task) |
396 | GNUNET_SCHEDULER_cancel (ac->delay_task); | 393 | GNUNET_SCHEDULER_cancel (ac->delay_task); |
397 | if (NULL != ac->put_data) | 394 | if (NULL != ac->put_data) |
398 | GNUNET_free (ac->put_data); | 395 | GNUNET_free (ac->put_data); |
399 | if (NULL != ac->dht_put) | 396 | if (NULL != ac->dht_put) |
400 | GNUNET_DHT_put_cancel (ac->dht_put); | 397 | GNUNET_DHT_put_cancel (ac->dht_put); |
401 | if (NULL != ac->dht_get) | 398 | if (NULL != ac->dht_get) |
402 | GNUNET_DHT_get_stop (ac->dht_get); | 399 | GNUNET_DHT_get_stop (ac->dht_get); |
400 | } | ||
401 | /* Cleanup testbed operation handle at the last as this operation may | ||
402 | contain service connection to DHT */ | ||
403 | if (NULL != a_ctx[cnt].op) | ||
404 | GNUNET_TESTBED_operation_done (a_ctx[cnt].op); | ||
403 | } | 405 | } |
404 | GNUNET_free (a_ctx); | 406 | GNUNET_free (a_ctx); |
405 | a_ctx = NULL; | 407 | a_ctx = NULL; |