aboutsummaryrefslogtreecommitdiff
path: root/src/fs/test_fs_search_persistence.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-03-28 14:10:02 +0000
committerChristian Grothoff <christian@grothoff.org>2013-03-28 14:10:02 +0000
commit677157767fc70a2176ecffadf60dc0fdf4eda5f8 (patch)
treedc35e3bdffd4b78a98876084599058ec48dfcc15 /src/fs/test_fs_search_persistence.c
parent87d828d4d8615c4958684f225c3917ff7516519b (diff)
downloadgnunet-677157767fc70a2176ecffadf60dc0fdf4eda5f8.tar.gz
gnunet-677157767fc70a2176ecffadf60dc0fdf4eda5f8.zip
-timeout
Diffstat (limited to 'src/fs/test_fs_search_persistence.c')
-rw-r--r--src/fs/test_fs_search_persistence.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/fs/test_fs_search_persistence.c b/src/fs/test_fs_search_persistence.c
index d66c5ec8e..4b60192e8 100644
--- a/src/fs/test_fs_search_persistence.c
+++ b/src/fs/test_fs_search_persistence.c
@@ -54,6 +54,28 @@ static struct GNUNET_FS_PublishContext *publish;
54 54
55static const struct GNUNET_CONFIGURATION_Handle *cfg; 55static const struct GNUNET_CONFIGURATION_Handle *cfg;
56 56
57static GNUNET_SCHEDULER_TaskIdentifier timeout_task;
58
59static int err;
60
61
62static void
63abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
64{
65 fprintf (stderr,
66 "Timeout\n");
67 if (NULL != publish)
68 {
69 GNUNET_FS_publish_stop (publish);
70 publish = NULL;
71 }
72 if (NULL != search)
73 {
74 GNUNET_FS_search_stop (search);
75 search = NULL;
76 }
77 err = 1;
78}
57 79
58static void 80static void
59abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 81abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
@@ -252,6 +274,8 @@ run (void *cls,
252 GNUNET_FS_publish_start (fs, fi, NULL, NULL, NULL, 274 GNUNET_FS_publish_start (fs, fi, NULL, NULL, NULL,
253 GNUNET_FS_PUBLISH_OPTION_NONE); 275 GNUNET_FS_PUBLISH_OPTION_NONE);
254 GNUNET_assert (publish != NULL); 276 GNUNET_assert (publish != NULL);
277 timeout_task = GNUNET_SCHEDULER_add_delayed (LIFETIME,
278 &abort_error, NULL);
255} 279}
256 280
257 281
@@ -262,7 +286,7 @@ main (int argc, char *argv[])
262 "test_fs_search_data.conf", 286 "test_fs_search_data.conf",
263 &run, NULL)) 287 &run, NULL))
264 return 1; 288 return 1;
265 return 0; 289 return err;
266} 290}
267 291
268/* end of test_fs_search_persistence.c */ 292/* end of test_fs_search_persistence.c */