aboutsummaryrefslogtreecommitdiff
path: root/src/fs/test_fs_test_lib.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-09-05 21:18:45 +0000
committerChristian Grothoff <christian@grothoff.org>2011-09-05 21:18:45 +0000
commit563b71afee70ac213a8bb28ce0697fcbae06aac3 (patch)
tree122d6a25630f68a9845651ba2295ef68f7d2af09 /src/fs/test_fs_test_lib.c
parentcf6e2bdb1b9a5aedc4f090df853814b9df817e03 (diff)
downloadgnunet-563b71afee70ac213a8bb28ce0697fcbae06aac3.tar.gz
gnunet-563b71afee70ac213a8bb28ce0697fcbae06aac3.zip
fixing API and clean up issues in testing
Diffstat (limited to 'src/fs/test_fs_test_lib.c')
-rw-r--r--src/fs/test_fs_test_lib.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/fs/test_fs_test_lib.c b/src/fs/test_fs_test_lib.c
index 458d4606b..1f2119259 100644
--- a/src/fs/test_fs_test_lib.c
+++ b/src/fs/test_fs_test_lib.c
@@ -44,11 +44,18 @@
44 44
45static struct GNUNET_FS_TestDaemon *daemons[NUM_DAEMONS]; 45static struct GNUNET_FS_TestDaemon *daemons[NUM_DAEMONS];
46 46
47static struct GNUNET_FS_TEST_ConnectContext *cc;
48
47static int ret; 49static int ret;
48 50
49static void 51static void
50do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 52do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
51{ 53{
54 if (NULL != cc)
55 {
56 GNUNET_FS_TEST_daemons_connect_cancel (cc);
57 cc = NULL;
58 }
52 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) 59 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
53 { 60 {
54 GNUNET_break (0); 61 GNUNET_break (0);
@@ -83,6 +90,7 @@ do_download (void *cls, const struct GNUNET_FS_Uri *uri)
83static void 90static void
84do_publish (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 91do_publish (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
85{ 92{
93 cc = NULL;
86 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) 94 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
87 { 95 {
88 GNUNET_break (0); 96 GNUNET_break (0);
@@ -109,8 +117,8 @@ do_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
109 } 117 }
110 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 118 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
111 "Daemons started, will now try to connect them\n"); 119 "Daemons started, will now try to connect them\n");
112 GNUNET_FS_TEST_daemons_connect (daemons[0], daemons[1], TIMEOUT, &do_publish, 120 cc = GNUNET_FS_TEST_daemons_connect (daemons[0], daemons[1], TIMEOUT, &do_publish,
113 NULL); 121 NULL);
114} 122}
115 123
116 124