aboutsummaryrefslogtreecommitdiff
path: root/src/fs/test_fs_test_lib.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-02-01 08:48:47 +0000
committerChristian Grothoff <christian@grothoff.org>2013-02-01 08:48:47 +0000
commit309276a88d1e57dffbea0014dc0708726c2e9376 (patch)
tree285ffccfe3cf9f69c7f3f537d80e473e8f087cc9 /src/fs/test_fs_test_lib.c
parent4785f9c53cad18c14a20e9341b86b97f1021a574 (diff)
downloadgnunet-309276a88d1e57dffbea0014dc0708726c2e9376.tar.gz
gnunet-309276a88d1e57dffbea0014dc0708726c2e9376.zip
-fix non-terminating index test --- do not remove file early
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 70e5977a6..2fe5a8140 100644
--- a/src/fs/test_fs_test_lib.c
+++ b/src/fs/test_fs_test_lib.c
@@ -50,6 +50,8 @@ static int ret;
50static void 50static void
51do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 51do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
52{ 52{
53 char *fn = cls;
54
53 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) 55 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
54 { 56 {
55 GNUNET_break (0); 57 GNUNET_break (0);
@@ -60,12 +62,18 @@ do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
60 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", 62 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n",
61 (unsigned long long) FILESIZE); 63 (unsigned long long) FILESIZE);
62 } 64 }
65 if (NULL != fn)
66 {
67 GNUNET_DISK_directory_remove (fn);
68 GNUNET_free (fn);
69 }
63 GNUNET_SCHEDULER_shutdown (); 70 GNUNET_SCHEDULER_shutdown ();
64} 71}
65 72
66 73
67static void 74static void
68do_download (void *cls, const struct GNUNET_FS_Uri *uri) 75do_download (void *cls, const struct GNUNET_FS_Uri *uri,
76 const char *fn)
69{ 77{
70 if (NULL == uri) 78 if (NULL == uri)
71 { 79 {
@@ -77,7 +85,7 @@ do_download (void *cls, const struct GNUNET_FS_Uri *uri)
77 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Downloading %llu bytes\n", 85 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Downloading %llu bytes\n",
78 (unsigned long long) FILESIZE); 86 (unsigned long long) FILESIZE);
79 GNUNET_FS_TEST_download (the_peers[0], TIMEOUT, 1, SEED, uri, VERBOSE, &do_stop, 87 GNUNET_FS_TEST_download (the_peers[0], TIMEOUT, 1, SEED, uri, VERBOSE, &do_stop,
80 NULL); 88 (NULL == fn) ? NULL : GNUNET_strdup (fn));
81} 89}
82 90
83 91