aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-03-29 14:36:18 +0000
committerChristian Grothoff <christian@grothoff.org>2013-03-29 14:36:18 +0000
commitc5bb1001b8315e59f213820b16e70d501ff02aa7 (patch)
treef95c7a8244f3a2b07a3c9de41016f6f671f7762b /src
parent663cc4e8d6359a3452ee5a907cf6919cc596d5bd (diff)
downloadgnunet-c5bb1001b8315e59f213820b16e70d501ff02aa7.tar.gz
gnunet-c5bb1001b8315e59f213820b16e70d501ff02aa7.zip
-fix fix
Diffstat (limited to 'src')
-rw-r--r--src/fs/test_fs_search.c17
-rw-r--r--src/fs/test_fs_search_persistence.c19
-rw-r--r--src/fs/test_fs_search_probes.c13
3 files changed, 38 insertions, 11 deletions
diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c
index 186365fdb..5103b6065 100644
--- a/src/fs/test_fs_search.c
+++ b/src/fs/test_fs_search.c
@@ -59,11 +59,17 @@ static int err;
59 59
60static void 60static void
61abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 61abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
62{ 62{
63 GNUNET_FS_publish_stop (publish); 63 if (NULL != publish)
64 publish = NULL; 64 {
65 GNUNET_SCHEDULER_cancel (timeout_task); 65 GNUNET_FS_publish_stop (publish);
66 timeout_task = GNUNET_SCHEDULER_NO_TASK; 66 publish = NULL;
67 }
68 if (GNUNET_SCHEDULER_NO_TASK != timeout_task)
69 {
70 GNUNET_SCHEDULER_cancel (timeout_task);
71 timeout_task = GNUNET_SCHEDULER_NO_TASK;
72 }
67} 73}
68 74
69 75
@@ -72,6 +78,7 @@ abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
72{ 78{
73 fprintf (stderr, 79 fprintf (stderr,
74 "Timeout\n"); 80 "Timeout\n");
81 timeout_task = GNUNET_SCHEDULER_NO_TASK;
75 if (NULL != search) 82 if (NULL != search)
76 { 83 {
77 GNUNET_FS_search_stop (search); 84 GNUNET_FS_search_stop (search);
diff --git a/src/fs/test_fs_search_persistence.c b/src/fs/test_fs_search_persistence.c
index 82f77d9e2..76308ecb9 100644
--- a/src/fs/test_fs_search_persistence.c
+++ b/src/fs/test_fs_search_persistence.c
@@ -62,6 +62,7 @@ static int err;
62static void 62static void
63abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 63abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
64{ 64{
65 timeout_task = GNUNET_SCHEDULER_NO_TASK;
65 fprintf (stderr, 66 fprintf (stderr,
66 "Timeout\n"); 67 "Timeout\n");
67 if (NULL != search) 68 if (NULL != search)
@@ -80,17 +81,27 @@ abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
80static void 81static void
81abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 82abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
82{ 83{
83 GNUNET_FS_publish_stop (publish); 84 if (NULL != publish)
84 publish = NULL; 85 {
86 GNUNET_FS_publish_stop (publish);
87 publish = NULL;
88 }
89 if (GNUNET_SCHEDULER_NO_TASK != timeout_task)
90 {
91 GNUNET_SCHEDULER_cancel (timeout_task);
92 timeout_task = GNUNET_SCHEDULER_NO_TASK;
93 }
85} 94}
86 95
87 96
88static void 97static void
89abort_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 98abort_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
90{ 99{
91 if (search != NULL) 100 if (NULL != search)
101 {
92 GNUNET_FS_search_stop (search); 102 GNUNET_FS_search_stop (search);
93 search = NULL; 103 search = NULL;
104 }
94} 105}
95 106
96 107
diff --git a/src/fs/test_fs_search_probes.c b/src/fs/test_fs_search_probes.c
index 442f99cb7..380c857aa 100644
--- a/src/fs/test_fs_search_probes.c
+++ b/src/fs/test_fs_search_probes.c
@@ -61,6 +61,7 @@ static int err;
61static void 61static void
62abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 62abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
63{ 63{
64 timeout_task = GNUNET_SCHEDULER_NO_TASK;
64 fprintf (stderr, 65 fprintf (stderr,
65 "Timeout\n"); 66 "Timeout\n");
66 if (NULL != search) 67 if (NULL != search)
@@ -80,8 +81,16 @@ abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
80static void 81static void
81abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 82abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
82{ 83{
83 GNUNET_FS_publish_stop (publish); 84 if (NULL != publish)
84 publish = NULL; 85 {
86 GNUNET_FS_publish_stop (publish);
87 publish = NULL;
88 }
89 if (GNUNET_SCHEDULER_NO_TASK != timeout_task)
90 {
91 GNUNET_SCHEDULER_cancel (timeout_task);
92 timeout_task = GNUNET_SCHEDULER_NO_TASK;
93 }
85} 94}
86 95
87 96