summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2014-08-22 14:37:39 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2014-08-22 14:37:39 +0000
commit68e27c68530fcdcba06b6e44ab411aad62eda0ac (patch)
tree35bdeee9095861f9228920fa5766d391ce603507 /src
parentd2fcf66a3f5b1b45b64ce039b5b604d157866e7f (diff)
Do not continue if we are going to shutdown.
Diffstat (limited to 'src')
-rw-r--r--src/dht/gnunet_dht_profiler.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/dht/gnunet_dht_profiler.c b/src/dht/gnunet_dht_profiler.c
index b95239f32..bc1ee86d8 100644
--- a/src/dht/gnunet_dht_profiler.c
+++ b/src/dht/gnunet_dht_profiler.c
@@ -349,7 +349,6 @@ struct Context **peer_contexts = NULL;
*/
static int peers_started = 0;
-
/**
* Should we do a PUT (mode = 0) or GET (mode = 1);
*/
@@ -360,6 +359,12 @@ static enum
MODE_GET = 1
} mode;
+
+/**
+ * Are we shutting down
+ */
+static int in_shutdown = 0;
+
/**
* Task that collects successor statistics from all the peers.
* @param cls
@@ -381,6 +386,7 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct ActiveContext *ac;
unsigned int cnt;
+ in_shutdown = GNUNET_YES;
if (NULL != a_ctx)
{
for (cnt=0; cnt < num_peers; cnt++)
@@ -786,6 +792,8 @@ dht_disconnect (void *cls, void *op_result)
n_dht--;
if (0 != n_dht)
return;
+ if (GNUNET_YES == in_shutdown)
+ return;
switch (mode)
{
case MODE_PUT:
@@ -815,6 +823,7 @@ start_profiling()
unsigned int i;
DEBUG("GNUNET_TESTBED_service_connect \n");
+ GNUNET_break (GNUNET_YES != in_shutdown);
for(i = 0; i < n_active; i++)
{
struct ActiveContext *ac = &a_ac[i];