diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:46:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:46:35 +0000 |
commit | 502af2167f7c218366666ca4944bd7cc54b5b19a (patch) | |
tree | a91fec5cc9769d260640bd91c6633cb9cf395524 /src/fs/test_fs_publish_persistence.c | |
parent | 03af5a603b7cc53432249d5854cd412aa90dde0d (diff) | |
download | gnunet-502af2167f7c218366666ca4944bd7cc54b5b19a.tar.gz gnunet-502af2167f7c218366666ca4944bd7cc54b5b19a.zip |
indentation
Diffstat (limited to 'src/fs/test_fs_publish_persistence.c')
-rw-r--r-- | src/fs/test_fs_publish_persistence.c | 324 |
1 files changed, 155 insertions, 169 deletions
diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c index 2d8332602..4dcf10965 100644 --- a/src/fs/test_fs_publish_persistence.c +++ b/src/fs/test_fs_publish_persistence.c | |||
@@ -45,7 +45,7 @@ | |||
45 | 45 | ||
46 | /** | 46 | /** |
47 | * How long should our test-content live? | 47 | * How long should our test-content live? |
48 | */ | 48 | */ |
49 | #define LIFETIME GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15) | 49 | #define LIFETIME GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15) |
50 | 50 | ||
51 | struct PeerContext | 51 | struct PeerContext |
@@ -77,8 +77,7 @@ static int err; | |||
77 | static GNUNET_SCHEDULER_TaskIdentifier rtask; | 77 | static GNUNET_SCHEDULER_TaskIdentifier rtask; |
78 | 78 | ||
79 | static void | 79 | static void |
80 | abort_publish_task (void *cls, | 80 | abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
81 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
82 | { | 81 | { |
83 | GNUNET_FS_publish_stop (publish); | 82 | GNUNET_FS_publish_stop (publish); |
84 | publish = NULL; | 83 | publish = NULL; |
@@ -91,30 +90,27 @@ abort_publish_task (void *cls, | |||
91 | GNUNET_FS_stop (fs); | 90 | GNUNET_FS_stop (fs); |
92 | fs = NULL; | 91 | fs = NULL; |
93 | if (GNUNET_SCHEDULER_NO_TASK != rtask) | 92 | if (GNUNET_SCHEDULER_NO_TASK != rtask) |
94 | { | 93 | { |
95 | GNUNET_SCHEDULER_cancel (rtask); | 94 | GNUNET_SCHEDULER_cancel (rtask); |
96 | rtask = GNUNET_SCHEDULER_NO_TASK; | 95 | rtask = GNUNET_SCHEDULER_NO_TASK; |
97 | } | 96 | } |
98 | } | 97 | } |
99 | 98 | ||
100 | 99 | ||
101 | static void * | 100 | static void *progress_cb (void *cls, |
102 | progress_cb (void *cls, | 101 | const struct GNUNET_FS_ProgressInfo *event); |
103 | const struct GNUNET_FS_ProgressInfo *event); | ||
104 | 102 | ||
105 | 103 | ||
106 | static void | 104 | static void |
107 | restart_fs_task (void *cls, | 105 | restart_fs_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
108 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
109 | { | 106 | { |
110 | rtask = GNUNET_SCHEDULER_NO_TASK; | 107 | rtask = GNUNET_SCHEDULER_NO_TASK; |
111 | GNUNET_FS_stop (fs); | 108 | GNUNET_FS_stop (fs); |
112 | fs = GNUNET_FS_start (cfg, | 109 | fs = GNUNET_FS_start (cfg, |
113 | "test-fs-publish-persistence", | 110 | "test-fs-publish-persistence", |
114 | &progress_cb, | 111 | &progress_cb, |
115 | NULL, | 112 | NULL, |
116 | GNUNET_FS_FLAGS_PERSISTENCE, | 113 | GNUNET_FS_FLAGS_PERSISTENCE, GNUNET_FS_OPTIONS_END); |
117 | GNUNET_FS_OPTIONS_END); | ||
118 | } | 114 | } |
119 | 115 | ||
120 | 116 | ||
@@ -131,111 +127,108 @@ consider_restart (int ev) | |||
131 | static int prev[32]; | 127 | static int prev[32]; |
132 | static int off; | 128 | static int off; |
133 | int i; | 129 | int i; |
134 | for (i=0;i<off;i++) | 130 | |
131 | for (i = 0; i < off; i++) | ||
135 | if (prev[i] == ev) | 132 | if (prev[i] == ev) |
136 | return; | 133 | return; |
137 | prev[off++] = ev; | 134 | prev[off++] = ev; |
138 | rtask = GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_URGENT, | 135 | rtask = GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_URGENT, |
139 | &restart_fs_task, | 136 | &restart_fs_task, NULL); |
140 | NULL); | ||
141 | } | 137 | } |
142 | 138 | ||
143 | 139 | ||
144 | static void * | 140 | static void * |
145 | progress_cb (void *cls, | 141 | progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) |
146 | const struct GNUNET_FS_ProgressInfo *event) | ||
147 | { | 142 | { |
148 | void *ret; | 143 | void *ret; |
149 | 144 | ||
150 | ret = NULL; | 145 | ret = NULL; |
151 | switch (event->status) | 146 | switch (event->status) |
152 | { | 147 | { |
153 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 148 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
154 | consider_restart (event->status); | 149 | consider_restart (event->status); |
155 | ret = event->value.publish.cctx; | 150 | ret = event->value.publish.cctx; |
156 | printf ("Publish complete, %llu kbps.\n", | 151 | printf ("Publish complete, %llu kbps.\n", |
157 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); | 152 | (unsigned long long) (FILESIZE * 1000LL / |
158 | if (0 == strcmp ("publish-context-dir", | 153 | (1 + |
159 | event->value.publish.cctx)) | 154 | GNUNET_TIME_absolute_get_duration |
160 | GNUNET_SCHEDULER_add_now (&abort_publish_task, | 155 | (start).rel_value) / 1024)); |
161 | NULL); | 156 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) |
162 | break; | 157 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
163 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: | 158 | break; |
164 | consider_restart (event->status); | 159 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: |
165 | ret = event->value.publish.cctx; | 160 | consider_restart (event->status); |
166 | GNUNET_assert (publish == event->value.publish.pc); | 161 | ret = event->value.publish.cctx; |
162 | GNUNET_assert (publish == event->value.publish.pc); | ||
167 | #if VERBOSE | 163 | #if VERBOSE |
168 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", | 164 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", |
169 | (unsigned long long) event->value.publish.completed, | 165 | (unsigned long long) event->value.publish.completed, |
170 | (unsigned long long) event->value.publish.size, | 166 | (unsigned long long) event->value.publish.size, |
171 | event->value.publish.specifics.progress.depth, | 167 | event->value.publish.specifics.progress.depth, |
172 | (unsigned long long) event->value.publish.specifics.progress.offset); | 168 | (unsigned long long) event->value.publish.specifics. |
169 | progress.offset); | ||
173 | #endif | 170 | #endif |
174 | break; | 171 | break; |
175 | case GNUNET_FS_STATUS_PUBLISH_SUSPEND: | 172 | case GNUNET_FS_STATUS_PUBLISH_SUSPEND: |
176 | if (event->value.publish.pc == publish) | 173 | if (event->value.publish.pc == publish) |
177 | publish = NULL; | 174 | publish = NULL; |
178 | break; | 175 | break; |
179 | case GNUNET_FS_STATUS_PUBLISH_RESUME: | 176 | case GNUNET_FS_STATUS_PUBLISH_RESUME: |
180 | if (NULL == publish) | 177 | if (NULL == publish) |
181 | { | 178 | { |
182 | GNUNET_assert (GNUNET_YES == | 179 | GNUNET_assert (GNUNET_YES == |
183 | GNUNET_FS_file_information_is_directory (event->value.publish.fi)); | 180 | GNUNET_FS_file_information_is_directory (event-> |
184 | publish = event->value.publish.pc; | 181 | value.publish. |
185 | return "publish-context-dir"; | 182 | fi)); |
186 | } | ||
187 | break; | ||
188 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | ||
189 | ret = event->value.publish.cctx; | ||
190 | fprintf (stderr, | ||
191 | "Error publishing file: %s\n", | ||
192 | event->value.publish.specifics.error.message); | ||
193 | err = 1; | ||
194 | GNUNET_SCHEDULER_add_now (&abort_publish_task, | ||
195 | NULL); | ||
196 | break; | ||
197 | case GNUNET_FS_STATUS_PUBLISH_START: | ||
198 | consider_restart (event->status); | ||
199 | publish = event->value.publish.pc; | 183 | publish = event->value.publish.pc; |
200 | ret = event->value.publish.cctx; | 184 | return "publish-context-dir"; |
201 | if (0 == strcmp ("publish-context1", | ||
202 | event->value.publish.cctx)) | ||
203 | { | ||
204 | GNUNET_assert (0 == strcmp ("publish-context-dir", | ||
205 | event->value.publish.pctx)); | ||
206 | GNUNET_assert (FILESIZE == event->value.publish.size); | ||
207 | GNUNET_assert (0 == event->value.publish.completed); | ||
208 | GNUNET_assert (1 == event->value.publish.anonymity); | ||
209 | } | ||
210 | else if (0 == strcmp ("publish-context2", | ||
211 | event->value.publish.cctx)) | ||
212 | { | ||
213 | GNUNET_assert (0 == strcmp ("publish-context-dir", | ||
214 | event->value.publish.pctx)); | ||
215 | GNUNET_assert (FILESIZE == event->value.publish.size); | ||
216 | GNUNET_assert (0 == event->value.publish.completed); | ||
217 | GNUNET_assert (2 == event->value.publish.anonymity); | ||
218 | } | ||
219 | else if (0 == strcmp ("publish-context-dir", | ||
220 | event->value.publish.cctx)) | ||
221 | { | ||
222 | GNUNET_assert (0 == event->value.publish.completed); | ||
223 | GNUNET_assert (3 == event->value.publish.anonymity); | ||
224 | } | ||
225 | else | ||
226 | GNUNET_assert (0); | ||
227 | break; | ||
228 | case GNUNET_FS_STATUS_PUBLISH_STOPPED: | ||
229 | consider_restart (event->status); | ||
230 | if (0 == strcmp ("publish-context-dir", | ||
231 | event->value.publish.cctx)) | ||
232 | GNUNET_assert (publish == event->value.publish.pc); | ||
233 | break; | ||
234 | default: | ||
235 | printf ("Unexpected event: %d\n", | ||
236 | event->status); | ||
237 | break; | ||
238 | } | 185 | } |
186 | break; | ||
187 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | ||
188 | ret = event->value.publish.cctx; | ||
189 | fprintf (stderr, | ||
190 | "Error publishing file: %s\n", | ||
191 | event->value.publish.specifics.error.message); | ||
192 | err = 1; | ||
193 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); | ||
194 | break; | ||
195 | case GNUNET_FS_STATUS_PUBLISH_START: | ||
196 | consider_restart (event->status); | ||
197 | publish = event->value.publish.pc; | ||
198 | ret = event->value.publish.cctx; | ||
199 | if (0 == strcmp ("publish-context1", event->value.publish.cctx)) | ||
200 | { | ||
201 | GNUNET_assert (0 == strcmp ("publish-context-dir", | ||
202 | event->value.publish.pctx)); | ||
203 | GNUNET_assert (FILESIZE == event->value.publish.size); | ||
204 | GNUNET_assert (0 == event->value.publish.completed); | ||
205 | GNUNET_assert (1 == event->value.publish.anonymity); | ||
206 | } | ||
207 | else if (0 == strcmp ("publish-context2", event->value.publish.cctx)) | ||
208 | { | ||
209 | GNUNET_assert (0 == strcmp ("publish-context-dir", | ||
210 | event->value.publish.pctx)); | ||
211 | GNUNET_assert (FILESIZE == event->value.publish.size); | ||
212 | GNUNET_assert (0 == event->value.publish.completed); | ||
213 | GNUNET_assert (2 == event->value.publish.anonymity); | ||
214 | } | ||
215 | else if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) | ||
216 | { | ||
217 | GNUNET_assert (0 == event->value.publish.completed); | ||
218 | GNUNET_assert (3 == event->value.publish.anonymity); | ||
219 | } | ||
220 | else | ||
221 | GNUNET_assert (0); | ||
222 | break; | ||
223 | case GNUNET_FS_STATUS_PUBLISH_STOPPED: | ||
224 | consider_restart (event->status); | ||
225 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) | ||
226 | GNUNET_assert (publish == event->value.publish.pc); | ||
227 | break; | ||
228 | default: | ||
229 | printf ("Unexpected event: %d\n", event->status); | ||
230 | break; | ||
231 | } | ||
239 | return ret; | 232 | return ret; |
240 | } | 233 | } |
241 | 234 | ||
@@ -246,11 +239,11 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
246 | p->cfg = GNUNET_CONFIGURATION_create (); | 239 | p->cfg = GNUNET_CONFIGURATION_create (); |
247 | #if START_ARM | 240 | #if START_ARM |
248 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", | 241 | p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", |
249 | "gnunet-service-arm", | 242 | "gnunet-service-arm", |
250 | #if VERBOSE | 243 | #if VERBOSE |
251 | "-L", "DEBUG", | 244 | "-L", "DEBUG", |
252 | #endif | 245 | #endif |
253 | "-c", cfgname, NULL); | 246 | "-c", cfgname, NULL); |
254 | #endif | 247 | #endif |
255 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); | 248 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); |
256 | } | 249 | } |
@@ -261,16 +254,17 @@ stop_arm (struct PeerContext *p) | |||
261 | { | 254 | { |
262 | #if START_ARM | 255 | #if START_ARM |
263 | if (NULL != p->arm_proc) | 256 | if (NULL != p->arm_proc) |
264 | { | 257 | { |
265 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) | 258 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
266 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 259 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
267 | if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK) | 260 | if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) |
268 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); | 261 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); |
269 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 262 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
270 | "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); | 263 | "ARM process %u stopped\n", |
271 | GNUNET_OS_process_close (p->arm_proc); | 264 | GNUNET_OS_process_get_pid (p->arm_proc)); |
272 | p->arm_proc = NULL; | 265 | GNUNET_OS_process_close (p->arm_proc); |
273 | } | 266 | p->arm_proc = NULL; |
267 | } | ||
274 | #endif | 268 | #endif |
275 | GNUNET_CONFIGURATION_destroy (p->cfg); | 269 | GNUNET_CONFIGURATION_destroy (p->cfg); |
276 | } | 270 | } |
@@ -279,8 +273,7 @@ stop_arm (struct PeerContext *p) | |||
279 | static void | 273 | static void |
280 | run (void *cls, | 274 | run (void *cls, |
281 | char *const *args, | 275 | char *const *args, |
282 | const char *cfgfile, | 276 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) |
283 | const struct GNUNET_CONFIGURATION_Handle *c) | ||
284 | { | 277 | { |
285 | const char *keywords[] = { | 278 | const char *keywords[] = { |
286 | "down_foo", | 279 | "down_foo", |
@@ -298,21 +291,21 @@ run (void *cls, | |||
298 | cfg = c; | 291 | cfg = c; |
299 | setup_peer (&p1, "test_fs_publish_data.conf"); | 292 | setup_peer (&p1, "test_fs_publish_data.conf"); |
300 | fs = GNUNET_FS_start (cfg, | 293 | fs = GNUNET_FS_start (cfg, |
301 | "test-fs-publish-persistence", | 294 | "test-fs-publish-persistence", |
302 | &progress_cb, | 295 | &progress_cb, |
303 | NULL, | 296 | NULL, |
304 | GNUNET_FS_FLAGS_PERSISTENCE, | 297 | GNUNET_FS_FLAGS_PERSISTENCE, GNUNET_FS_OPTIONS_END); |
305 | GNUNET_FS_OPTIONS_END); | 298 | GNUNET_assert (NULL != fs); |
306 | GNUNET_assert (NULL != fs); | ||
307 | fn1 = GNUNET_DISK_mktemp ("gnunet-publish-test-dst"); | 299 | fn1 = GNUNET_DISK_mktemp ("gnunet-publish-test-dst"); |
308 | buf = GNUNET_malloc (FILESIZE); | 300 | buf = GNUNET_malloc (FILESIZE); |
309 | for (i = 0; i < FILESIZE; i++) | 301 | for (i = 0; i < FILESIZE; i++) |
310 | buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256); | 302 | buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256); |
311 | GNUNET_assert (FILESIZE == | 303 | GNUNET_assert (FILESIZE == |
312 | GNUNET_DISK_fn_write (fn1, | 304 | GNUNET_DISK_fn_write (fn1, |
313 | buf, | 305 | buf, |
314 | FILESIZE, | 306 | FILESIZE, |
315 | GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE)); | 307 | GNUNET_DISK_PERM_USER_READ | |
308 | GNUNET_DISK_PERM_USER_WRITE)); | ||
316 | GNUNET_free (buf); | 309 | GNUNET_free (buf); |
317 | 310 | ||
318 | fn2 = GNUNET_DISK_mktemp ("gnunet-publish-test-dst"); | 311 | fn2 = GNUNET_DISK_mktemp ("gnunet-publish-test-dst"); |
@@ -320,10 +313,11 @@ run (void *cls, | |||
320 | for (i = 0; i < FILESIZE; i++) | 313 | for (i = 0; i < FILESIZE; i++) |
321 | buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256); | 314 | buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256); |
322 | GNUNET_assert (FILESIZE == | 315 | GNUNET_assert (FILESIZE == |
323 | GNUNET_DISK_fn_write (fn2, | 316 | GNUNET_DISK_fn_write (fn2, |
324 | buf, | 317 | buf, |
325 | FILESIZE, | 318 | FILESIZE, |
326 | GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE)); | 319 | GNUNET_DISK_PERM_USER_READ | |
320 | GNUNET_DISK_PERM_USER_WRITE)); | ||
327 | GNUNET_free (buf); | 321 | GNUNET_free (buf); |
328 | 322 | ||
329 | meta = GNUNET_CONTAINER_meta_data_create (); | 323 | meta = GNUNET_CONTAINER_meta_data_create (); |
@@ -331,30 +325,24 @@ run (void *cls, | |||
331 | bo.content_priority = 42; | 325 | bo.content_priority = 42; |
332 | bo.anonymity_level = 1; | 326 | bo.anonymity_level = 1; |
333 | bo.replication_level = 0; | 327 | bo.replication_level = 0; |
334 | bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME); | 328 | bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME); |
335 | fi1 = GNUNET_FS_file_information_create_from_file (fs, | 329 | fi1 = GNUNET_FS_file_information_create_from_file (fs, |
336 | "publish-context1", | 330 | "publish-context1", |
337 | fn1, | 331 | fn1, |
338 | kuri, | 332 | kuri, |
339 | meta, | 333 | meta, GNUNET_YES, &bo); |
340 | GNUNET_YES, | ||
341 | &bo); | ||
342 | GNUNET_assert (NULL != fi1); | 334 | GNUNET_assert (NULL != fi1); |
343 | bo.anonymity_level = 2; | 335 | bo.anonymity_level = 2; |
344 | fi2 = GNUNET_FS_file_information_create_from_file (fs, | 336 | fi2 = GNUNET_FS_file_information_create_from_file (fs, |
345 | "publish-context2", | 337 | "publish-context2", |
346 | fn2, | 338 | fn2, |
347 | kuri, | 339 | kuri, |
348 | meta, | 340 | meta, GNUNET_YES, &bo); |
349 | GNUNET_YES, | ||
350 | &bo); | ||
351 | GNUNET_assert (NULL != fi2); | 341 | GNUNET_assert (NULL != fi2); |
352 | bo.anonymity_level = 3; | 342 | bo.anonymity_level = 3; |
353 | fidir = GNUNET_FS_file_information_create_empty_directory (fs, | 343 | fidir = GNUNET_FS_file_information_create_empty_directory (fs, |
354 | "publish-context-dir", | 344 | "publish-context-dir", |
355 | kuri, | 345 | kuri, meta, &bo); |
356 | meta, | ||
357 | &bo); | ||
358 | GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi1)); | 346 | GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi1)); |
359 | GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi2)); | 347 | GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi2)); |
360 | GNUNET_FS_uri_destroy (kuri); | 348 | GNUNET_FS_uri_destroy (kuri); |
@@ -362,9 +350,8 @@ run (void *cls, | |||
362 | GNUNET_assert (NULL != fidir); | 350 | GNUNET_assert (NULL != fidir); |
363 | start = GNUNET_TIME_absolute_get (); | 351 | start = GNUNET_TIME_absolute_get (); |
364 | GNUNET_FS_publish_start (fs, | 352 | GNUNET_FS_publish_start (fs, |
365 | fidir, | 353 | fidir, |
366 | NULL, NULL, NULL, | 354 | NULL, NULL, NULL, GNUNET_FS_PUBLISH_OPTION_NONE); |
367 | GNUNET_FS_PUBLISH_OPTION_NONE); | ||
368 | GNUNET_assert (publish != NULL); | 355 | GNUNET_assert (publish != NULL); |
369 | } | 356 | } |
370 | 357 | ||
@@ -372,7 +359,7 @@ run (void *cls, | |||
372 | int | 359 | int |
373 | main (int argc, char *argv[]) | 360 | main (int argc, char *argv[]) |
374 | { | 361 | { |
375 | char *const argvx[] = { | 362 | char *const argvx[] = { |
376 | "test-fs-publish-persistence", | 363 | "test-fs-publish-persistence", |
377 | "-c", | 364 | "-c", |
378 | "test_fs_publish_data.conf", | 365 | "test_fs_publish_data.conf", |
@@ -385,28 +372,27 @@ main (int argc, char *argv[]) | |||
385 | GNUNET_GETOPT_OPTION_END | 372 | GNUNET_GETOPT_OPTION_END |
386 | }; | 373 | }; |
387 | 374 | ||
388 | GNUNET_log_setup ("test_fs_publish_persistence", | 375 | GNUNET_log_setup ("test_fs_publish_persistence", |
389 | #if VERBOSE | 376 | #if VERBOSE |
390 | "DEBUG", | 377 | "DEBUG", |
391 | #else | 378 | #else |
392 | "WARNING", | 379 | "WARNING", |
393 | #endif | 380 | #endif |
394 | NULL); | 381 | NULL); |
395 | GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, | 382 | GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, |
396 | argvx, "test-fs-publish", | 383 | argvx, "test-fs-publish", "nohelp", options, &run, NULL); |
397 | "nohelp", options, &run, NULL); | ||
398 | stop_arm (&p1); | 384 | stop_arm (&p1); |
399 | GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-publish/"); | 385 | GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-publish/"); |
400 | if (fn1 != NULL) | 386 | if (fn1 != NULL) |
401 | { | 387 | { |
402 | GNUNET_DISK_directory_remove (fn1); | 388 | GNUNET_DISK_directory_remove (fn1); |
403 | GNUNET_free (fn1); | 389 | GNUNET_free (fn1); |
404 | } | 390 | } |
405 | if (fn2 != NULL) | 391 | if (fn2 != NULL) |
406 | { | 392 | { |
407 | GNUNET_DISK_directory_remove (fn2); | 393 | GNUNET_DISK_directory_remove (fn2); |
408 | GNUNET_free (fn2); | 394 | GNUNET_free (fn2); |
409 | } | 395 | } |
410 | return err; | 396 | return err; |
411 | } | 397 | } |
412 | 398 | ||