diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-02-01 08:48:47 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-02-01 08:48:47 +0000 |
commit | 309276a88d1e57dffbea0014dc0708726c2e9376 (patch) | |
tree | 285ffccfe3cf9f69c7f3f537d80e473e8f087cc9 /src/fs/test_gnunet_service_fs_p2p.c | |
parent | 4785f9c53cad18c14a20e9341b86b97f1021a574 (diff) | |
download | gnunet-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.c | 13 |
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; | |||
56 | static void | 56 | static void |
57 | do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 57 | do_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 | ||
85 | static void | 91 | static void |
86 | do_download (void *cls, const struct GNUNET_FS_Uri *uri) | 92 | do_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 | ||