aboutsummaryrefslogtreecommitdiff
path: root/src/fs/test_gnunet_service_fs_p2p.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_gnunet_service_fs_p2p.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_gnunet_service_fs_p2p.c')
-rw-r--r--src/fs/test_gnunet_service_fs_p2p.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/fs/test_gnunet_service_fs_p2p.c b/src/fs/test_gnunet_service_fs_p2p.c
index 889337ff4..d293bd66d 100644
--- a/src/fs/test_gnunet_service_fs_p2p.c
+++ b/src/fs/test_gnunet_service_fs_p2p.c
@@ -56,6 +56,7 @@ static struct GNUNET_TIME_Absolute start_time;
56static void 56static void
57do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 57do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
58{ 58{
59 char *fn = cls;
59 struct GNUNET_TIME_Relative del; 60 struct GNUNET_TIME_Relative del;
60 char *fancy; 61 char *fancy;
61 62
@@ -79,11 +80,17 @@ do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
79 "Timeout during download, shutting down with error\n"); 80 "Timeout during download, shutting down with error\n");
80 ok = 1; 81 ok = 1;
81 } 82 }
83 if (NULL != fn)
84 {
85 GNUNET_DISK_directory_remove (fn);
86 GNUNET_free (fn);
87 }
82} 88}
83 89
84 90
85static void 91static void
86do_download (void *cls, const struct GNUNET_FS_Uri *uri) 92do_download (void *cls, const struct GNUNET_FS_Uri *uri,
93 const char *fn)
87{ 94{
88 if (NULL == uri) 95 if (NULL == uri)
89 { 96 {
@@ -99,7 +106,9 @@ do_download (void *cls, const struct GNUNET_FS_Uri *uri)
99 GNUNET_FS_TEST_download (daemons[0], TIMEOUT, 106 GNUNET_FS_TEST_download (daemons[0], TIMEOUT,
100 anonymity_level, SEED, uri, 107 anonymity_level, SEED, uri,
101 VERBOSE, &do_stop, 108 VERBOSE, &do_stop,
102 NULL); 109 (NULL == fn)
110 ? NULL
111 : GNUNET_strdup (fn));
103} 112}
104 113
105 114