aboutsummaryrefslogtreecommitdiff
path: root/src/fs/test_gnunet_service_fs_p2p.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_gnunet_service_fs_p2p.c
parentcf6e2bdb1b9a5aedc4f090df853814b9df817e03 (diff)
downloadgnunet-563b71afee70ac213a8bb28ce0697fcbae06aac3.tar.gz
gnunet-563b71afee70ac213a8bb28ce0697fcbae06aac3.zip
fixing API and clean up issues in testing
Diffstat (limited to 'src/fs/test_gnunet_service_fs_p2p.c')
-rw-r--r--src/fs/test_gnunet_service_fs_p2p.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/fs/test_gnunet_service_fs_p2p.c b/src/fs/test_gnunet_service_fs_p2p.c
index aece0e80a..26372cfa8 100644
--- a/src/fs/test_gnunet_service_fs_p2p.c
+++ b/src/fs/test_gnunet_service_fs_p2p.c
@@ -48,12 +48,19 @@ static int ok;
48 48
49static struct GNUNET_TIME_Absolute start_time; 49static struct GNUNET_TIME_Absolute start_time;
50 50
51static struct GNUNET_FS_TEST_ConnectContext *cc;
52
51static void 53static void
52do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 54do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
53{ 55{
54 struct GNUNET_TIME_Relative del; 56 struct GNUNET_TIME_Relative del;
55 char *fancy; 57 char *fancy;
56 58
59 if (NULL != cc)
60 {
61 GNUNET_FS_TEST_daemons_connect_cancel (cc);
62 cc = NULL;
63 }
57 GNUNET_FS_TEST_daemons_stop (NUM_DAEMONS, daemons); 64 GNUNET_FS_TEST_daemons_stop (NUM_DAEMONS, daemons);
58 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) 65 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
59 { 66 {
@@ -99,6 +106,7 @@ do_download (void *cls, const struct GNUNET_FS_Uri *uri)
99static void 106static void
100do_publish (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 107do_publish (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
101{ 108{
109 cc = NULL;
102 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) 110 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
103 { 111 {
104 GNUNET_FS_TEST_daemons_stop (NUM_DAEMONS, daemons); 112 GNUNET_FS_TEST_daemons_stop (NUM_DAEMONS, daemons);
@@ -120,8 +128,8 @@ do_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
120 GNUNET_assert (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)); 128 GNUNET_assert (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE));
121 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 129 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
122 "Daemons started, will now try to connect them\n"); 130 "Daemons started, will now try to connect them\n");
123 GNUNET_FS_TEST_daemons_connect (daemons[0], daemons[1], TIMEOUT, &do_publish, 131 cc = GNUNET_FS_TEST_daemons_connect (daemons[0], daemons[1], TIMEOUT, &do_publish,
124 NULL); 132 NULL);
125} 133}
126 134
127 135