summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-05-05 14:09:06 +0000
committerChristian Grothoff <christian@grothoff.org>2011-05-05 14:09:06 +0000
commitbb83cd2d04ff5a3f7a8d05fc9a724b0246e958b6 (patch)
treec4871898c122cb581453f98fd6d85e2aaecc8b6e /src
parentaf628f3f58cd9d3cf5c1708cdc81fd743aea8076 (diff)
proper shutdown
Diffstat (limited to 'src')
-rw-r--r--src/fs/fs_test_lib.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c
index c379d91ad..522967f13 100644
--- a/src/fs/fs_test_lib.c
+++ b/src/fs/fs_test_lib.c
@@ -528,6 +528,7 @@ GNUNET_FS_TEST_daemons_stop (unsigned int total,
unsigned int i;
struct GNUNET_TESTING_PeerGroup *pg;
struct GNUNET_CONFIGURATION_Handle *gcfg;
+ struct GNUNET_FS_TestDaemon *daemon;
GNUNET_assert (total > 0);
GNUNET_assert (daemons[0] != NULL);
@@ -535,18 +536,34 @@ GNUNET_FS_TEST_daemons_stop (unsigned int total,
gcfg = daemons[0]->gcfg;
for (i=0;i<total;i++)
{
- if (daemons[i]->fs != NULL)
- GNUNET_FS_stop (daemons[i]->fs);
- if (daemons[i]->cfg != NULL)
- GNUNET_CONFIGURATION_destroy (daemons[i]->cfg);
- if (NULL != daemons[i]->publish_tmp_file)
+ daemon = daemons[i];
+ if (daemon->download_timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ {
+ GNUNET_SCHEDULER_cancel (daemon->download_timeout_task);
+ daemon->download_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ }
+ if (daemon->publish_timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ {
+ GNUNET_SCHEDULER_cancel (daemon->publish_timeout_task);
+ daemon->publish_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ }
+ if (NULL != daemon->download_context)
+ {
+ GNUNET_FS_download_stop (daemon->download_context, GNUNET_YES);
+ daemon->download_context = NULL;
+ }
+ if (daemon->fs != NULL)
+ GNUNET_FS_stop (daemon->fs);
+ if (daemon->cfg != NULL)
+ GNUNET_CONFIGURATION_destroy (daemon->cfg);
+ if (NULL != daemon->publish_tmp_file)
{
GNUNET_break (GNUNET_OK ==
- GNUNET_DISK_directory_remove (daemons[i]->publish_tmp_file));
- GNUNET_free (daemons[i]->publish_tmp_file);
- daemons[i]->publish_tmp_file = NULL;
+ GNUNET_DISK_directory_remove (daemon->publish_tmp_file));
+ GNUNET_free (daemon->publish_tmp_file);
+ daemon->publish_tmp_file = NULL;
}
- GNUNET_free (daemons[i]);
+ GNUNET_free (daemon);
daemons[i] = NULL;
}
GNUNET_TESTING_daemons_stop (pg,