diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fs/fs_test_lib.c | 29 | ||||
-rw-r--r-- | src/fs/fs_test_lib.h | 35 | ||||
-rw-r--r-- | src/fs/gnunet-download.c | 3 | ||||
-rw-r--r-- | src/fs/gnunet-search.c | 3 | ||||
-rw-r--r-- | src/fs/gnunet-unindex.c | 3 | ||||
-rw-r--r-- | src/fs/perf_gnunet_service_fs_p2p.c | 29 | ||||
-rw-r--r-- | src/fs/perf_gnunet_service_fs_p2p_respect.c | 6 | ||||
-rw-r--r-- | src/fs/test_fs_download.c | 6 | ||||
-rw-r--r-- | src/fs/test_fs_download_persistence.c | 6 | ||||
-rw-r--r-- | src/fs/test_fs_list_indexed.c | 13 | ||||
-rw-r--r-- | src/fs/test_fs_namespace.c | 9 | ||||
-rw-r--r-- | src/fs/test_fs_publish.c | 6 | ||||
-rw-r--r-- | src/fs/test_fs_search.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_search_persistence.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_search_probes.c | 13 | ||||
-rw-r--r-- | src/fs/test_fs_search_with_and.c | 20 | ||||
-rw-r--r-- | src/fs/test_fs_test_lib.c | 25 | ||||
-rw-r--r-- | src/fs/test_fs_unindex.c | 12 | ||||
-rw-r--r-- | src/fs/test_fs_unindex_persistence.c | 12 | ||||
-rw-r--r-- | src/fs/test_gnunet_service_fs_migration.c | 60 | ||||
-rw-r--r-- | src/fs/test_gnunet_service_fs_p2p.c | 25 |
21 files changed, 183 insertions, 156 deletions
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c index a848a8bc9..a80793912 100644 --- a/src/fs/fs_test_lib.c +++ b/src/fs/fs_test_lib.c | |||
@@ -245,8 +245,8 @@ publish_progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
245 | po->publish_timeout_task = NULL; | 245 | po->publish_timeout_task = NULL; |
246 | po->publish_uri = | 246 | po->publish_uri = |
247 | GNUNET_FS_uri_dup (info->value.publish.specifics.completed.chk_uri); | 247 | GNUNET_FS_uri_dup (info->value.publish.specifics.completed.chk_uri); |
248 | GNUNET_SCHEDULER_add_continuation (&report_uri, po, | 248 | GNUNET_SCHEDULER_add_now (&report_uri, |
249 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 249 | po); |
250 | break; | 250 | break; |
251 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: | 251 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: |
252 | if (po->verbose) | 252 | if (po->verbose) |
@@ -490,10 +490,10 @@ download_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
490 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 490 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
491 | "Timeout while trying to download file\n"); | 491 | "Timeout while trying to download file\n"); |
492 | dop->download_timeout_task = NULL; | 492 | dop->download_timeout_task = NULL; |
493 | GNUNET_FS_download_stop (dop->download_context, GNUNET_YES); | 493 | GNUNET_FS_download_stop (dop->download_context, |
494 | GNUNET_SCHEDULER_add_continuation (dop->download_cont, | 494 | GNUNET_YES); |
495 | dop->download_cont_cls, | 495 | GNUNET_SCHEDULER_add_now (dop->download_cont, |
496 | GNUNET_SCHEDULER_REASON_TIMEOUT); | 496 | dop->download_cont_cls); |
497 | GNUNET_TESTBED_operation_done (dop->fs_op); | 497 | GNUNET_TESTBED_operation_done (dop->fs_op); |
498 | GNUNET_FS_uri_destroy (dop->uri); | 498 | GNUNET_FS_uri_destroy (dop->uri); |
499 | GNUNET_free (dop); | 499 | GNUNET_free (dop); |
@@ -512,10 +512,10 @@ report_success (void *cls, | |||
512 | { | 512 | { |
513 | struct TestDownloadOperation *dop = cls; | 513 | struct TestDownloadOperation *dop = cls; |
514 | 514 | ||
515 | GNUNET_FS_download_stop (dop->download_context, GNUNET_YES); | 515 | GNUNET_FS_download_stop (dop->download_context, |
516 | GNUNET_SCHEDULER_add_continuation (dop->download_cont, | 516 | GNUNET_YES); |
517 | dop->download_cont_cls, | 517 | GNUNET_SCHEDULER_add_now (dop->download_cont, |
518 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 518 | dop->download_cont_cls); |
519 | GNUNET_TESTBED_operation_done (dop->fs_op); | 519 | GNUNET_TESTBED_operation_done (dop->fs_op); |
520 | GNUNET_FS_uri_destroy (dop->uri); | 520 | GNUNET_FS_uri_destroy (dop->uri); |
521 | GNUNET_free (dop); | 521 | GNUNET_free (dop); |
@@ -529,7 +529,8 @@ report_success (void *cls, | |||
529 | * @param info information about the event | 529 | * @param info information about the event |
530 | */ | 530 | */ |
531 | static void * | 531 | static void * |
532 | download_progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | 532 | download_progress_cb (void *cls, |
533 | const struct GNUNET_FS_ProgressInfo *info) | ||
533 | { | 534 | { |
534 | struct TestDownloadOperation *dop = cls; | 535 | struct TestDownloadOperation *dop = cls; |
535 | 536 | ||
@@ -537,15 +538,15 @@ download_progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
537 | { | 538 | { |
538 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: | 539 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: |
539 | if (dop->verbose) | 540 | if (dop->verbose) |
540 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Download at %llu/%llu bytes\n", | 541 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
542 | "Download at %llu/%llu bytes\n", | ||
541 | (unsigned long long) info->value.download.completed, | 543 | (unsigned long long) info->value.download.completed, |
542 | (unsigned long long) info->value.download.size); | 544 | (unsigned long long) info->value.download.size); |
543 | break; | 545 | break; |
544 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: | 546 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: |
545 | GNUNET_SCHEDULER_cancel (dop->download_timeout_task); | 547 | GNUNET_SCHEDULER_cancel (dop->download_timeout_task); |
546 | dop->download_timeout_task = NULL; | 548 | dop->download_timeout_task = NULL; |
547 | GNUNET_SCHEDULER_add_continuation (&report_success, dop, | 549 | GNUNET_SCHEDULER_add_now (&report_success, dop); |
548 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
549 | break; | 550 | break; |
550 | case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE: | 551 | case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE: |
551 | case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE: | 552 | case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE: |
diff --git a/src/fs/fs_test_lib.h b/src/fs/fs_test_lib.h index 2a8237aac..72348e018 100644 --- a/src/fs/fs_test_lib.h +++ b/src/fs/fs_test_lib.h | |||
@@ -42,10 +42,10 @@ | |||
42 | * @param fn name of the file on disk to be removed upon | 42 | * @param fn name of the file on disk to be removed upon |
43 | * completion, or NULL for inserted files (also NULL on error) | 43 | * completion, or NULL for inserted files (also NULL on error) |
44 | */ | 44 | */ |
45 | typedef void (*GNUNET_FS_TEST_UriContinuation) (void *cls, | 45 | typedef void |
46 | const struct GNUNET_FS_Uri * | 46 | (*GNUNET_FS_TEST_UriContinuation) (void *cls, |
47 | uri, | 47 | const struct GNUNET_FS_Uri *uri, |
48 | const char *fn); | 48 | const char *fn); |
49 | 49 | ||
50 | 50 | ||
51 | /** | 51 | /** |
@@ -55,20 +55,24 @@ typedef void (*GNUNET_FS_TEST_UriContinuation) (void *cls, | |||
55 | * @param timeout if this operation cannot be completed within the | 55 | * @param timeout if this operation cannot be completed within the |
56 | * given period, call the continuation with an error code | 56 | * given period, call the continuation with an error code |
57 | * @param anonymity option for publication | 57 | * @param anonymity option for publication |
58 | * @param do_index GNUNET_YES for index, GNUNET_NO for insertion, | 58 | * @param do_index #GNUNET_YES for index, #GNUNET_NO for insertion, |
59 | * GNUNET_SYSERR for simulation | 59 | * #GNUNET_SYSERR for simulation |
60 | * @param size size of the file to publish | 60 | * @param size size of the file to publish |
61 | * @param seed seed to use for file generation | 61 | * @param seed seed to use for file generation |
62 | * @param verbose how verbose to be in reporting | 62 | * @param verbose how verbose to be in reporting |
63 | * @param cont function to call when done | 63 | * @param cont function to call when done |
64 | * @param cont_cls closure for cont | 64 | * @param cont_cls closure for @a cont |
65 | */ | 65 | */ |
66 | void | 66 | void |
67 | GNUNET_FS_TEST_publish (struct GNUNET_TESTBED_Peer *peer, | 67 | GNUNET_FS_TEST_publish (struct GNUNET_TESTBED_Peer *peer, |
68 | struct GNUNET_TIME_Relative timeout, uint32_t anonymity, | 68 | struct GNUNET_TIME_Relative timeout, |
69 | int do_index, uint64_t size, uint32_t seed, | 69 | uint32_t anonymity, |
70 | int do_index, | ||
71 | uint64_t size, | ||
72 | uint32_t seed, | ||
70 | unsigned int verbose, | 73 | unsigned int verbose, |
71 | GNUNET_FS_TEST_UriContinuation cont, void *cont_cls); | 74 | GNUNET_FS_TEST_UriContinuation cont, |
75 | void *cont_cls); | ||
72 | 76 | ||
73 | 77 | ||
74 | /** | 78 | /** |
@@ -82,14 +86,17 @@ GNUNET_FS_TEST_publish (struct GNUNET_TESTBED_Peer *peer, | |||
82 | * @param uri URI of file to download (CHK/LOC only) | 86 | * @param uri URI of file to download (CHK/LOC only) |
83 | * @param verbose how verbose to be in reporting | 87 | * @param verbose how verbose to be in reporting |
84 | * @param cont function to call when done | 88 | * @param cont function to call when done |
85 | * @param cont_cls closure for cont | 89 | * @param cont_cls closure for @a cont |
86 | */ | 90 | */ |
87 | void | 91 | void |
88 | GNUNET_FS_TEST_download (struct GNUNET_TESTBED_Peer *peer, | 92 | GNUNET_FS_TEST_download (struct GNUNET_TESTBED_Peer *peer, |
89 | struct GNUNET_TIME_Relative timeout, | 93 | struct GNUNET_TIME_Relative timeout, |
90 | uint32_t anonymity, uint32_t seed, | 94 | uint32_t anonymity, |
91 | const struct GNUNET_FS_Uri *uri, unsigned int verbose, | 95 | uint32_t seed, |
92 | GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls); | 96 | const struct GNUNET_FS_Uri *uri, |
97 | unsigned int verbose, | ||
98 | GNUNET_SCHEDULER_TaskCallback cont, | ||
99 | void *cont_cls); | ||
93 | 100 | ||
94 | 101 | ||
95 | 102 | ||
diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c index 10f890c0f..0f1dfaa7c 100644 --- a/src/fs/gnunet-download.c +++ b/src/fs/gnunet-download.c | |||
@@ -199,8 +199,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
199 | break; | 199 | break; |
200 | case GNUNET_FS_STATUS_DOWNLOAD_STOPPED: | 200 | case GNUNET_FS_STATUS_DOWNLOAD_STOPPED: |
201 | if (info->value.download.dc == dc) | 201 | if (info->value.download.dc == dc) |
202 | GNUNET_SCHEDULER_add_continuation (&cleanup_task, NULL, | 202 | GNUNET_SCHEDULER_add_now (&cleanup_task, NULL); |
203 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
204 | break; | 203 | break; |
205 | case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE: | 204 | case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE: |
206 | case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE: | 205 | case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE: |
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c index 0c25388fd..5d7633591 100644 --- a/src/fs/gnunet-search.c +++ b/src/fs/gnunet-search.c | |||
@@ -199,8 +199,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
199 | GNUNET_SCHEDULER_shutdown (); | 199 | GNUNET_SCHEDULER_shutdown (); |
200 | break; | 200 | break; |
201 | case GNUNET_FS_STATUS_SEARCH_STOPPED: | 201 | case GNUNET_FS_STATUS_SEARCH_STOPPED: |
202 | GNUNET_SCHEDULER_add_continuation (&clean_task, NULL, | 202 | GNUNET_SCHEDULER_add_now (&clean_task, NULL); |
203 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
204 | break; | 203 | break; |
205 | default: | 204 | default: |
206 | FPRINTF (stderr, _("Unexpected status: %d\n"), info->status); | 205 | FPRINTF (stderr, _("Unexpected status: %d\n"), info->status); |
diff --git a/src/fs/gnunet-unindex.c b/src/fs/gnunet-unindex.c index 5383930e9..52a795240 100644 --- a/src/fs/gnunet-unindex.c +++ b/src/fs/gnunet-unindex.c | |||
@@ -101,8 +101,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
101 | GNUNET_SCHEDULER_shutdown (); | 101 | GNUNET_SCHEDULER_shutdown (); |
102 | break; | 102 | break; |
103 | case GNUNET_FS_STATUS_UNINDEX_STOPPED: | 103 | case GNUNET_FS_STATUS_UNINDEX_STOPPED: |
104 | GNUNET_SCHEDULER_add_continuation (&cleanup_task, NULL, | 104 | GNUNET_SCHEDULER_add_now (&cleanup_task, NULL); |
105 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
106 | break; | 105 | break; |
107 | default: | 106 | default: |
108 | FPRINTF (stderr, _("Unexpected status: %d\n"), info->status); | 107 | FPRINTF (stderr, _("Unexpected status: %d\n"), info->status); |
diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c index 5f9c80705..e2f58d13d 100644 --- a/src/fs/perf_gnunet_service_fs_p2p.c +++ b/src/fs/perf_gnunet_service_fs_p2p.c | |||
@@ -51,6 +51,8 @@ static struct GNUNET_TIME_Absolute start_time; | |||
51 | 51 | ||
52 | static const char *progname; | 52 | static const char *progname; |
53 | 53 | ||
54 | static struct GNUNET_TIME_Absolute start_time; | ||
55 | |||
54 | 56 | ||
55 | /** | 57 | /** |
56 | * Master context for 'stat_run'. | 58 | * Master context for 'stat_run'. |
@@ -105,8 +107,8 @@ static struct StatValues stats[] = { | |||
105 | * @param subsystem name of subsystem that created the statistic | 107 | * @param subsystem name of subsystem that created the statistic |
106 | * @param name the name of the datum | 108 | * @param name the name of the datum |
107 | * @param value the current value | 109 | * @param value the current value |
108 | * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not | 110 | * @param is_persistent #GNUNET_YES if the value is persistent, #GNUNET_NO if not |
109 | * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration | 111 | * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration |
110 | */ | 112 | */ |
111 | static int | 113 | static int |
112 | print_stat (void *cls, const char *subsystem, const char *name, uint64_t value, | 114 | print_stat (void *cls, const char *subsystem, const char *name, uint64_t value, |
@@ -114,8 +116,12 @@ print_stat (void *cls, const char *subsystem, const char *name, uint64_t value, | |||
114 | { | 116 | { |
115 | struct StatMaster *sm = cls; | 117 | struct StatMaster *sm = cls; |
116 | 118 | ||
117 | FPRINTF (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem, | 119 | FPRINTF (stderr, |
118 | name, (unsigned long long) value); | 120 | "Peer %2u: %12s/%50s = %12llu\n", |
121 | sm->daemon, | ||
122 | subsystem, | ||
123 | name, | ||
124 | (unsigned long long) value); | ||
119 | return GNUNET_OK; | 125 | return GNUNET_OK; |
120 | } | 126 | } |
121 | 127 | ||
@@ -232,7 +238,8 @@ stat_run (void *cls, | |||
232 | 238 | ||
233 | 239 | ||
234 | static void | 240 | static void |
235 | do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 241 | do_report (void *cls, |
242 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
236 | { | 243 | { |
237 | char *fn = cls; | 244 | char *fn = cls; |
238 | struct GNUNET_TIME_Relative del; | 245 | struct GNUNET_TIME_Relative del; |
@@ -244,7 +251,9 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
244 | GNUNET_DISK_directory_remove (fn); | 251 | GNUNET_DISK_directory_remove (fn); |
245 | GNUNET_free (fn); | 252 | GNUNET_free (fn); |
246 | } | 253 | } |
247 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT)) | 254 | if (0 == |
255 | GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_add (start_time, | ||
256 | TIMEOUT)).rel_value_us) | ||
248 | { | 257 | { |
249 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 258 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
250 | "Timeout during download, shutting down with error\n"); | 259 | "Timeout during download, shutting down with error\n"); |
@@ -297,7 +306,13 @@ do_download (void *cls, | |||
297 | anonymity = 0; | 306 | anonymity = 0; |
298 | else | 307 | else |
299 | anonymity = 1; | 308 | anonymity = 1; |
300 | GNUNET_FS_TEST_download (daemons[0], TIMEOUT, anonymity, SEED, uri, VERBOSE, | 309 | start_time = GNUNET_TIME_absolute_get (); |
310 | GNUNET_FS_TEST_download (daemons[0], | ||
311 | TIMEOUT, | ||
312 | anonymity, | ||
313 | SEED, | ||
314 | uri, | ||
315 | VERBOSE, | ||
301 | &do_report, | 316 | &do_report, |
302 | (NULL == fn) ? NULL : GNUNET_strdup (fn)); | 317 | (NULL == fn) ? NULL : GNUNET_strdup (fn)); |
303 | } | 318 | } |
diff --git a/src/fs/perf_gnunet_service_fs_p2p_respect.c b/src/fs/perf_gnunet_service_fs_p2p_respect.c index 6b70afbf5..01f8dbe26 100644 --- a/src/fs/perf_gnunet_service_fs_p2p_respect.c +++ b/src/fs/perf_gnunet_service_fs_p2p_respect.c | |||
@@ -287,7 +287,9 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
287 | char *fancy; | 287 | char *fancy; |
288 | struct StatMaster *sm; | 288 | struct StatMaster *sm; |
289 | 289 | ||
290 | if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) | 290 | if (0 == |
291 | GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_add (start_time, | ||
292 | TIMEOUT)).rel_value_us) | ||
291 | { | 293 | { |
292 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 294 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
293 | "Timeout during download for type `%s', shutting down with error\n", | 295 | "Timeout during download for type `%s', shutting down with error\n", |
@@ -362,7 +364,7 @@ do_downloads (void *cls, const struct GNUNET_FS_Uri *u2, | |||
362 | 364 | ||
363 | 365 | ||
364 | static void | 366 | static void |
365 | do_publish2 (void *cls, | 367 | do_publish2 (void *cls, |
366 | const struct GNUNET_FS_Uri *u1, | 368 | const struct GNUNET_FS_Uri *u1, |
367 | const char *fn) | 369 | const char *fn) |
368 | { | 370 | { |
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c index d0cc4d6f0..32d5f5a34 100644 --- a/src/fs/test_fs_download.c +++ b/src/fs/test_fs_download.c | |||
@@ -198,8 +198,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
198 | FPRINTF (stderr, "Error publishing file: %s\n", | 198 | FPRINTF (stderr, "Error publishing file: %s\n", |
199 | event->value.publish.specifics.error.message); | 199 | event->value.publish.specifics.error.message); |
200 | GNUNET_break (0); | 200 | GNUNET_break (0); |
201 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 201 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
202 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
203 | GNUNET_SCHEDULER_shutdown (); | 202 | GNUNET_SCHEDULER_shutdown (); |
204 | break; | 203 | break; |
205 | case GNUNET_FS_STATUS_DOWNLOAD_ERROR: | 204 | case GNUNET_FS_STATUS_DOWNLOAD_ERROR: |
@@ -235,8 +234,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
235 | break; | 234 | break; |
236 | case GNUNET_FS_STATUS_DOWNLOAD_STOPPED: | 235 | case GNUNET_FS_STATUS_DOWNLOAD_STOPPED: |
237 | GNUNET_assert (download == event->value.download.dc); | 236 | GNUNET_assert (download == event->value.download.dc); |
238 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 237 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
239 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
240 | break; | 238 | break; |
241 | default: | 239 | default: |
242 | printf ("Unexpected event: %d\n", event->status); | 240 | printf ("Unexpected event: %d\n", event->status); |
diff --git a/src/fs/test_fs_download_persistence.c b/src/fs/test_fs_download_persistence.c index 3de1fa9cb..fd1dbf242 100644 --- a/src/fs/test_fs_download_persistence.c +++ b/src/fs/test_fs_download_persistence.c | |||
@@ -202,8 +202,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
202 | FPRINTF (stderr, "Error publishing file: %s\n", | 202 | FPRINTF (stderr, "Error publishing file: %s\n", |
203 | event->value.publish.specifics.error.message); | 203 | event->value.publish.specifics.error.message); |
204 | GNUNET_break (0); | 204 | GNUNET_break (0); |
205 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 205 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
206 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
207 | break; | 206 | break; |
208 | case GNUNET_FS_STATUS_DOWNLOAD_ERROR: | 207 | case GNUNET_FS_STATUS_DOWNLOAD_ERROR: |
209 | FPRINTF (stderr, "Error downloading file: %s\n", | 208 | FPRINTF (stderr, "Error downloading file: %s\n", |
@@ -265,8 +264,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
265 | break; | 264 | break; |
266 | case GNUNET_FS_STATUS_DOWNLOAD_STOPPED: | 265 | case GNUNET_FS_STATUS_DOWNLOAD_STOPPED: |
267 | GNUNET_assert (download == event->value.download.dc); | 266 | GNUNET_assert (download == event->value.download.dc); |
268 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 267 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
269 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
270 | download = NULL; | 268 | download = NULL; |
271 | break; | 269 | break; |
272 | default: | 270 | default: |
diff --git a/src/fs/test_fs_list_indexed.c b/src/fs/test_fs_list_indexed.c index 7059d30b5..97f465f79 100644 --- a/src/fs/test_fs_list_indexed.c +++ b/src/fs/test_fs_list_indexed.c | |||
@@ -76,11 +76,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
76 | 76 | ||
77 | 77 | ||
78 | static void | 78 | static void |
79 | list_indexed_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 79 | list_indexed_task (void *cls, |
80 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
80 | { | 81 | { |
81 | 82 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); | |
82 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | ||
83 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
84 | } | 83 | } |
85 | 84 | ||
86 | 85 | ||
@@ -100,8 +99,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
100 | GNUNET_TIME_absolute_get_duration | 99 | GNUNET_TIME_absolute_get_duration |
101 | (start).rel_value_us) / 1024)); | 100 | (start).rel_value_us) / 1024)); |
102 | if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx)) | 101 | if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx)) |
103 | GNUNET_SCHEDULER_add_continuation (&list_indexed_task, NULL, | 102 | GNUNET_SCHEDULER_add_now (&list_indexed_task, NULL); |
104 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
105 | 103 | ||
106 | break; | 104 | break; |
107 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: | 105 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: |
@@ -124,8 +122,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
124 | event->value.publish.specifics.error.message); | 122 | event->value.publish.specifics.error.message); |
125 | err = 1; | 123 | err = 1; |
126 | if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx)) | 124 | if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx)) |
127 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 125 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
128 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
129 | break; | 126 | break; |
130 | case GNUNET_FS_STATUS_PUBLISH_START: | 127 | case GNUNET_FS_STATUS_PUBLISH_START: |
131 | ret = event->value.publish.cctx; | 128 | ret = event->value.publish.cctx; |
diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c index 628cc0f1d..99af39d5c 100644 --- a/src/fs/test_fs_namespace.c +++ b/src/fs/test_fs_namespace.c | |||
@@ -118,8 +118,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
118 | FPRINTF (stderr, "%s", "Wrong result for ksk search!\n"); | 118 | FPRINTF (stderr, "%s", "Wrong result for ksk search!\n"); |
119 | err = 1; | 119 | err = 1; |
120 | } | 120 | } |
121 | GNUNET_SCHEDULER_add_continuation (&abort_ksk_search_task, NULL, | 121 | GNUNET_SCHEDULER_add_now (&abort_ksk_search_task, NULL); |
122 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
123 | } | 122 | } |
124 | else | 123 | else |
125 | { | 124 | { |
@@ -131,11 +130,9 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
131 | FPRINTF (stderr, "Error searching file: %s\n", | 130 | FPRINTF (stderr, "Error searching file: %s\n", |
132 | event->value.search.specifics.error.message); | 131 | event->value.search.specifics.error.message); |
133 | if (sks_search == event->value.search.sc) | 132 | if (sks_search == event->value.search.sc) |
134 | GNUNET_SCHEDULER_add_continuation (&abort_sks_search_task, NULL, | 133 | GNUNET_SCHEDULER_add_now (&abort_sks_search_task, NULL); |
135 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
136 | else if (ksk_search == event->value.search.sc) | 134 | else if (ksk_search == event->value.search.sc) |
137 | GNUNET_SCHEDULER_add_continuation (&abort_ksk_search_task, NULL, | 135 | GNUNET_SCHEDULER_add_now (&abort_ksk_search_task, NULL); |
138 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
139 | else | 136 | else |
140 | GNUNET_break (0); | 137 | GNUNET_break (0); |
141 | break; | 138 | break; |
diff --git a/src/fs/test_fs_publish.c b/src/fs/test_fs_publish.c index 0d621e489..481108d50 100644 --- a/src/fs/test_fs_publish.c +++ b/src/fs/test_fs_publish.c | |||
@@ -87,8 +87,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
87 | GNUNET_TIME_absolute_get_duration | 87 | GNUNET_TIME_absolute_get_duration |
88 | (start).rel_value_us) / 1024)); | 88 | (start).rel_value_us) / 1024)); |
89 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) | 89 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) |
90 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 90 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
91 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
92 | break; | 91 | break; |
93 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: | 92 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: |
94 | ret = event->value.publish.cctx; | 93 | ret = event->value.publish.cctx; |
@@ -113,8 +112,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
113 | { | 112 | { |
114 | FPRINTF (stderr, "Scheduling abort task for error on `%s'\n", | 113 | FPRINTF (stderr, "Scheduling abort task for error on `%s'\n", |
115 | (const char *) event->value.publish.cctx); | 114 | (const char *) event->value.publish.cctx); |
116 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 115 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
117 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
118 | } | 116 | } |
119 | break; | 117 | break; |
120 | case GNUNET_FS_STATUS_PUBLISH_START: | 118 | case GNUNET_FS_STATUS_PUBLISH_START: |
diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c index a3f498f77..c24d062dd 100644 --- a/src/fs/test_fs_search.c +++ b/src/fs/test_fs_search.c | |||
@@ -137,21 +137,18 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
137 | case GNUNET_FS_STATUS_SEARCH_RESULT: | 137 | case GNUNET_FS_STATUS_SEARCH_RESULT: |
138 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 138 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
139 | "Search complete.\n"); | 139 | "Search complete.\n"); |
140 | GNUNET_SCHEDULER_add_continuation (&abort_search_task, NULL, | 140 | GNUNET_SCHEDULER_add_now (&abort_search_task, NULL); |
141 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
142 | break; | 141 | break; |
143 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 142 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
144 | FPRINTF (stderr, "Error publishing file: %s\n", | 143 | FPRINTF (stderr, "Error publishing file: %s\n", |
145 | event->value.publish.specifics.error.message); | 144 | event->value.publish.specifics.error.message); |
146 | GNUNET_break (0); | 145 | GNUNET_break (0); |
147 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 146 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
148 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
149 | break; | 147 | break; |
150 | case GNUNET_FS_STATUS_SEARCH_ERROR: | 148 | case GNUNET_FS_STATUS_SEARCH_ERROR: |
151 | FPRINTF (stderr, "Error searching file: %s\n", | 149 | FPRINTF (stderr, "Error searching file: %s\n", |
152 | event->value.search.specifics.error.message); | 150 | event->value.search.specifics.error.message); |
153 | GNUNET_SCHEDULER_add_continuation (&abort_search_task, NULL, | 151 | GNUNET_SCHEDULER_add_now (&abort_search_task, NULL); |
154 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
155 | break; | 152 | break; |
156 | case GNUNET_FS_STATUS_PUBLISH_START: | 153 | case GNUNET_FS_STATUS_PUBLISH_START: |
157 | GNUNET_assert (0 == strcmp ("publish-context", event->value.publish.cctx)); | 154 | GNUNET_assert (0 == strcmp ("publish-context", event->value.publish.cctx)); |
@@ -176,8 +173,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
176 | break; | 173 | break; |
177 | case GNUNET_FS_STATUS_SEARCH_STOPPED: | 174 | case GNUNET_FS_STATUS_SEARCH_STOPPED: |
178 | GNUNET_assert (search == event->value.search.sc); | 175 | GNUNET_assert (search == event->value.search.sc); |
179 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 176 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
180 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
181 | break; | 177 | break; |
182 | default: | 178 | default: |
183 | FPRINTF (stderr, "Unexpected event: %d\n", event->status); | 179 | FPRINTF (stderr, "Unexpected event: %d\n", event->status); |
diff --git a/src/fs/test_fs_search_persistence.c b/src/fs/test_fs_search_persistence.c index 43275fb8d..7c84c24c9 100644 --- a/src/fs/test_fs_search_persistence.c +++ b/src/fs/test_fs_search_persistence.c | |||
@@ -183,21 +183,18 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
183 | * search result since we exit here after the first one... */ | 183 | * search result since we exit here after the first one... */ |
184 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 184 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
185 | "Search complete.\n"); | 185 | "Search complete.\n"); |
186 | GNUNET_SCHEDULER_add_continuation (&abort_search_task, NULL, | 186 | GNUNET_SCHEDULER_add_now (&abort_search_task, NULL); |
187 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
188 | break; | 187 | break; |
189 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 188 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
190 | FPRINTF (stderr, "Error publishing file: %s\n", | 189 | FPRINTF (stderr, "Error publishing file: %s\n", |
191 | event->value.publish.specifics.error.message); | 190 | event->value.publish.specifics.error.message); |
192 | GNUNET_break (0); | 191 | GNUNET_break (0); |
193 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 192 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
194 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
195 | break; | 193 | break; |
196 | case GNUNET_FS_STATUS_SEARCH_ERROR: | 194 | case GNUNET_FS_STATUS_SEARCH_ERROR: |
197 | FPRINTF (stderr, "Error searching file: %s\n", | 195 | FPRINTF (stderr, "Error searching file: %s\n", |
198 | event->value.search.specifics.error.message); | 196 | event->value.search.specifics.error.message); |
199 | GNUNET_SCHEDULER_add_continuation (&abort_search_task, NULL, | 197 | GNUNET_SCHEDULER_add_now (&abort_search_task, NULL); |
200 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
201 | break; | 198 | break; |
202 | case GNUNET_FS_STATUS_SEARCH_SUSPEND: | 199 | case GNUNET_FS_STATUS_SEARCH_SUSPEND: |
203 | if (event->value.search.sc == search) | 200 | if (event->value.search.sc == search) |
@@ -235,8 +232,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
235 | break; | 232 | break; |
236 | case GNUNET_FS_STATUS_SEARCH_STOPPED: | 233 | case GNUNET_FS_STATUS_SEARCH_STOPPED: |
237 | GNUNET_assert (search == event->value.search.sc); | 234 | GNUNET_assert (search == event->value.search.sc); |
238 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 235 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
239 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
240 | search = NULL; | 236 | search = NULL; |
241 | break; | 237 | break; |
242 | default: | 238 | default: |
diff --git a/src/fs/test_fs_search_probes.c b/src/fs/test_fs_search_probes.c index 203d3fa36..218951509 100644 --- a/src/fs/test_fs_search_probes.c +++ b/src/fs/test_fs_search_probes.c | |||
@@ -140,14 +140,12 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
140 | FPRINTF (stderr, "Error publishing file: %s\n", | 140 | FPRINTF (stderr, "Error publishing file: %s\n", |
141 | event->value.publish.specifics.error.message); | 141 | event->value.publish.specifics.error.message); |
142 | GNUNET_break (0); | 142 | GNUNET_break (0); |
143 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 143 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
144 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
145 | break; | 144 | break; |
146 | case GNUNET_FS_STATUS_SEARCH_ERROR: | 145 | case GNUNET_FS_STATUS_SEARCH_ERROR: |
147 | FPRINTF (stderr, "Error searching file: %s\n", | 146 | FPRINTF (stderr, "Error searching file: %s\n", |
148 | event->value.search.specifics.error.message); | 147 | event->value.search.specifics.error.message); |
149 | GNUNET_SCHEDULER_add_continuation (&abort_search_task, NULL, | 148 | GNUNET_SCHEDULER_add_now (&abort_search_task, NULL); |
150 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
151 | break; | 149 | break; |
152 | case GNUNET_FS_STATUS_PUBLISH_START: | 150 | case GNUNET_FS_STATUS_PUBLISH_START: |
153 | GNUNET_assert (0 == strcmp ("publish-context", event->value.publish.cctx)); | 151 | GNUNET_assert (0 == strcmp ("publish-context", event->value.publish.cctx)); |
@@ -177,11 +175,12 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
177 | break; | 175 | break; |
178 | case GNUNET_FS_STATUS_SEARCH_STOPPED: | 176 | case GNUNET_FS_STATUS_SEARCH_STOPPED: |
179 | GNUNET_assert (search == event->value.search.sc); | 177 | GNUNET_assert (search == event->value.search.sc); |
180 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 178 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
181 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
182 | break; | 179 | break; |
183 | default: | 180 | default: |
184 | FPRINTF (stderr, "Unexpected event: %d\n", event->status); | 181 | FPRINTF (stderr, |
182 | "Unexpected event: %d\n", | ||
183 | event->status); | ||
185 | break; | 184 | break; |
186 | } | 185 | } |
187 | return NULL; | 186 | return NULL; |
diff --git a/src/fs/test_fs_search_with_and.c b/src/fs/test_fs_search_with_and.c index 55498ddca..7798f88c0 100644 --- a/src/fs/test_fs_search_with_and.c +++ b/src/fs/test_fs_search_with_and.c | |||
@@ -138,7 +138,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
138 | char *emsg = NULL; | 138 | char *emsg = NULL; |
139 | kuri = GNUNET_FS_uri_ksk_create ("+down_foo +down_bar", &emsg); | 139 | kuri = GNUNET_FS_uri_ksk_create ("+down_foo +down_bar", &emsg); |
140 | GNUNET_assert (kuri != NULL); | 140 | GNUNET_assert (kuri != NULL); |
141 | 141 | ||
142 | start = GNUNET_TIME_absolute_get (); | 142 | start = GNUNET_TIME_absolute_get (); |
143 | search = | 143 | search = |
144 | GNUNET_FS_search_start (fs, kuri, 1, GNUNET_FS_SEARCH_OPTION_NONE, | 144 | GNUNET_FS_search_start (fs, kuri, 1, GNUNET_FS_SEARCH_OPTION_NONE, |
@@ -150,21 +150,18 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
150 | case GNUNET_FS_STATUS_SEARCH_RESULT: | 150 | case GNUNET_FS_STATUS_SEARCH_RESULT: |
151 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 151 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
152 | "Search complete.\n"); | 152 | "Search complete.\n"); |
153 | GNUNET_SCHEDULER_add_continuation (&abort_search_task, NULL, | 153 | GNUNET_SCHEDULER_add_now (&abort_search_task, NULL); |
154 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
155 | break; | 154 | break; |
156 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 155 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
157 | FPRINTF (stderr, "Error publishing file: %s\n", | 156 | FPRINTF (stderr, "Error publishing file: %s\n", |
158 | event->value.publish.specifics.error.message); | 157 | event->value.publish.specifics.error.message); |
159 | GNUNET_break (0); | 158 | GNUNET_break (0); |
160 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 159 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
161 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
162 | break; | 160 | break; |
163 | case GNUNET_FS_STATUS_SEARCH_ERROR: | 161 | case GNUNET_FS_STATUS_SEARCH_ERROR: |
164 | FPRINTF (stderr, "Error searching file: %s\n", | 162 | FPRINTF (stderr, "Error searching file: %s\n", |
165 | event->value.search.specifics.error.message); | 163 | event->value.search.specifics.error.message); |
166 | GNUNET_SCHEDULER_add_continuation (&abort_search_task, NULL, | 164 | GNUNET_SCHEDULER_add_now (&abort_search_task, NULL); |
167 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
168 | break; | 165 | break; |
169 | case GNUNET_FS_STATUS_PUBLISH_START: | 166 | case GNUNET_FS_STATUS_PUBLISH_START: |
170 | GNUNET_assert (0 == strcmp ("publish-context", event->value.publish.cctx)); | 167 | GNUNET_assert (0 == strcmp ("publish-context", event->value.publish.cctx)); |
@@ -189,8 +186,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
189 | break; | 186 | break; |
190 | case GNUNET_FS_STATUS_SEARCH_STOPPED: | 187 | case GNUNET_FS_STATUS_SEARCH_STOPPED: |
191 | GNUNET_assert (search == event->value.search.sc); | 188 | GNUNET_assert (search == event->value.search.sc); |
192 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 189 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
193 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
194 | break; | 190 | break; |
195 | default: | 191 | default: |
196 | FPRINTF (stderr, "Unexpected event: %d\n", event->status); | 192 | FPRINTF (stderr, "Unexpected event: %d\n", event->status); |
@@ -220,7 +216,7 @@ run (void *cls, | |||
220 | fs = GNUNET_FS_start (cfg, "test-fs-search", &progress_cb, NULL, | 216 | fs = GNUNET_FS_start (cfg, "test-fs-search", &progress_cb, NULL, |
221 | GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END); | 217 | GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END); |
222 | GNUNET_assert (NULL != fs); | 218 | GNUNET_assert (NULL != fs); |
223 | 219 | ||
224 | processed_files = 0; | 220 | processed_files = 0; |
225 | for(j = 0; j < NUM_FILES; j++){ | 221 | for(j = 0; j < NUM_FILES; j++){ |
226 | buf = GNUNET_malloc (FILESIZE); | 222 | buf = GNUNET_malloc (FILESIZE); |
@@ -244,8 +240,8 @@ run (void *cls, | |||
244 | GNUNET_FS_PUBLISH_OPTION_NONE); | 240 | GNUNET_FS_PUBLISH_OPTION_NONE); |
245 | GNUNET_assert (publish != NULL); | 241 | GNUNET_assert (publish != NULL); |
246 | } | 242 | } |
247 | 243 | ||
248 | 244 | ||
249 | timeout_task = GNUNET_SCHEDULER_add_delayed (LIFETIME, | 245 | timeout_task = GNUNET_SCHEDULER_add_delayed (LIFETIME, |
250 | &abort_error, NULL); | 246 | &abort_error, NULL); |
251 | } | 247 | } |
diff --git a/src/fs/test_fs_test_lib.c b/src/fs/test_fs_test_lib.c index bc950ed75..3f802bfcf 100644 --- a/src/fs/test_fs_test_lib.c +++ b/src/fs/test_fs_test_lib.c | |||
@@ -44,22 +44,28 @@ | |||
44 | 44 | ||
45 | static struct GNUNET_TESTBED_Peer *the_peers[NUM_DAEMONS]; | 45 | static struct GNUNET_TESTBED_Peer *the_peers[NUM_DAEMONS]; |
46 | 46 | ||
47 | static struct GNUNET_TIME_Absolute start_time; | ||
48 | |||
47 | static int ret; | 49 | static int ret; |
48 | 50 | ||
49 | 51 | ||
50 | static void | 52 | static void |
51 | do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 53 | do_stop (void *cls, |
54 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
52 | { | 55 | { |
53 | char *fn = cls; | 56 | char *fn = cls; |
54 | 57 | ||
55 | if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) | 58 | if (0 == |
59 | GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_add (start_time, | ||
60 | TIMEOUT)).rel_value_us) | ||
56 | { | 61 | { |
57 | GNUNET_break (0); | 62 | GNUNET_break (0); |
58 | ret = 1; | 63 | ret = 1; |
59 | } | 64 | } |
60 | else | 65 | else |
61 | { | 66 | { |
62 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", | 67 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
68 | "Finished download, shutting down\n", | ||
63 | (unsigned long long) FILESIZE); | 69 | (unsigned long long) FILESIZE); |
64 | } | 70 | } |
65 | if (NULL != fn) | 71 | if (NULL != fn) |
@@ -72,7 +78,8 @@ do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
72 | 78 | ||
73 | 79 | ||
74 | static void | 80 | static void |
75 | do_download (void *cls, const struct GNUNET_FS_Uri *uri, | 81 | do_download (void *cls, |
82 | const struct GNUNET_FS_Uri *uri, | ||
76 | const char *fn) | 83 | const char *fn) |
77 | { | 84 | { |
78 | if (NULL == uri) | 85 | if (NULL == uri) |
@@ -82,9 +89,15 @@ do_download (void *cls, const struct GNUNET_FS_Uri *uri, | |||
82 | ret = 1; | 89 | ret = 1; |
83 | return; | 90 | return; |
84 | } | 91 | } |
85 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Downloading %llu bytes\n", | 92 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
93 | "Downloading %llu bytes\n", | ||
86 | (unsigned long long) FILESIZE); | 94 | (unsigned long long) FILESIZE); |
87 | GNUNET_FS_TEST_download (the_peers[0], TIMEOUT, 1, SEED, uri, VERBOSE, &do_stop, | 95 | start_time = GNUNET_TIME_absolute_get (); |
96 | GNUNET_FS_TEST_download (the_peers[0], | ||
97 | TIMEOUT, 1, SEED, | ||
98 | uri, | ||
99 | VERBOSE, | ||
100 | &do_stop, | ||
88 | (NULL == fn) ? NULL : GNUNET_strdup (fn)); | 101 | (NULL == fn) ? NULL : GNUNET_strdup (fn)); |
89 | } | 102 | } |
90 | 103 | ||
diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c index dcde15bc0..c7a0c7cd5 100644 --- a/src/fs/test_fs_unindex.c +++ b/src/fs/test_fs_unindex.c | |||
@@ -108,8 +108,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
108 | (1 + | 108 | (1 + |
109 | GNUNET_TIME_absolute_get_duration | 109 | GNUNET_TIME_absolute_get_duration |
110 | (start).rel_value_us) / 1024)); | 110 | (start).rel_value_us) / 1024)); |
111 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, | 111 | GNUNET_SCHEDULER_add_now (&abort_unindex_task, NULL); |
112 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
113 | break; | 112 | break; |
114 | case GNUNET_FS_STATUS_UNINDEX_PROGRESS: | 113 | case GNUNET_FS_STATUS_UNINDEX_PROGRESS: |
115 | GNUNET_assert (unindex == event->value.unindex.uc); | 114 | GNUNET_assert (unindex == event->value.unindex.uc); |
@@ -125,14 +124,12 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
125 | FPRINTF (stderr, "Error publishing file: %s\n", | 124 | FPRINTF (stderr, "Error publishing file: %s\n", |
126 | event->value.publish.specifics.error.message); | 125 | event->value.publish.specifics.error.message); |
127 | GNUNET_break (0); | 126 | GNUNET_break (0); |
128 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 127 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
129 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
130 | break; | 128 | break; |
131 | case GNUNET_FS_STATUS_UNINDEX_ERROR: | 129 | case GNUNET_FS_STATUS_UNINDEX_ERROR: |
132 | FPRINTF (stderr, "Error unindexing file: %s\n", | 130 | FPRINTF (stderr, "Error unindexing file: %s\n", |
133 | event->value.unindex.specifics.error.message); | 131 | event->value.unindex.specifics.error.message); |
134 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, | 132 | GNUNET_SCHEDULER_add_now (&abort_unindex_task, NULL); |
135 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
136 | break; | 133 | break; |
137 | case GNUNET_FS_STATUS_PUBLISH_START: | 134 | case GNUNET_FS_STATUS_PUBLISH_START: |
138 | GNUNET_assert (0 == strcmp ("publish-context", event->value.publish.cctx)); | 135 | GNUNET_assert (0 == strcmp ("publish-context", event->value.publish.cctx)); |
@@ -157,8 +154,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
157 | break; | 154 | break; |
158 | case GNUNET_FS_STATUS_UNINDEX_STOPPED: | 155 | case GNUNET_FS_STATUS_UNINDEX_STOPPED: |
159 | GNUNET_assert (unindex == event->value.unindex.uc); | 156 | GNUNET_assert (unindex == event->value.unindex.uc); |
160 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 157 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
161 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
162 | break; | 158 | break; |
163 | default: | 159 | default: |
164 | printf ("Unexpected event: %d\n", event->status); | 160 | printf ("Unexpected event: %d\n", event->status); |
diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c index 628bc85d2..ccb628a63 100644 --- a/src/fs/test_fs_unindex_persistence.c +++ b/src/fs/test_fs_unindex_persistence.c | |||
@@ -150,8 +150,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
150 | (1 + | 150 | (1 + |
151 | GNUNET_TIME_absolute_get_duration | 151 | GNUNET_TIME_absolute_get_duration |
152 | (start).rel_value_us) / 1024)); | 152 | (start).rel_value_us) / 1024)); |
153 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, | 153 | GNUNET_SCHEDULER_add_now (&abort_unindex_task, NULL); |
154 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
155 | break; | 154 | break; |
156 | case GNUNET_FS_STATUS_UNINDEX_PROGRESS: | 155 | case GNUNET_FS_STATUS_UNINDEX_PROGRESS: |
157 | consider_restart (event->status); | 156 | consider_restart (event->status); |
@@ -187,15 +186,13 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
187 | FPRINTF (stderr, "Error publishing file: %s\n", | 186 | FPRINTF (stderr, "Error publishing file: %s\n", |
188 | event->value.publish.specifics.error.message); | 187 | event->value.publish.specifics.error.message); |
189 | GNUNET_break (0); | 188 | GNUNET_break (0); |
190 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 189 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
191 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
192 | break; | 190 | break; |
193 | case GNUNET_FS_STATUS_UNINDEX_ERROR: | 191 | case GNUNET_FS_STATUS_UNINDEX_ERROR: |
194 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 192 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
195 | "Error unindexing file: %s\n", | 193 | "Error unindexing file: %s\n", |
196 | event->value.unindex.specifics.error.message); | 194 | event->value.unindex.specifics.error.message); |
197 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, | 195 | GNUNET_SCHEDULER_add_now (&abort_unindex_task, NULL); |
198 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
199 | break; | 196 | break; |
200 | case GNUNET_FS_STATUS_PUBLISH_START: | 197 | case GNUNET_FS_STATUS_PUBLISH_START: |
201 | GNUNET_assert (0 == strcmp ("publish-context", event->value.publish.cctx)); | 198 | GNUNET_assert (0 == strcmp ("publish-context", event->value.publish.cctx)); |
@@ -221,8 +218,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
221 | break; | 218 | break; |
222 | case GNUNET_FS_STATUS_UNINDEX_STOPPED: | 219 | case GNUNET_FS_STATUS_UNINDEX_STOPPED: |
223 | GNUNET_assert (unindex == event->value.unindex.uc); | 220 | GNUNET_assert (unindex == event->value.unindex.uc); |
224 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 221 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
225 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
226 | break; | 222 | break; |
227 | default: | 223 | default: |
228 | printf ("Unexpected event: %d\n", event->status); | 224 | printf ("Unexpected event: %d\n", event->status); |
diff --git a/src/fs/test_gnunet_service_fs_migration.c b/src/fs/test_gnunet_service_fs_migration.c index 94b6452d6..69fd4619a 100644 --- a/src/fs/test_gnunet_service_fs_migration.c +++ b/src/fs/test_gnunet_service_fs_migration.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2010, 2012 Christian Grothoff (and other contributing authors) | 3 | Copyright (C) 2010, 2012, 2015 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -64,13 +64,22 @@ struct DownloadContext | |||
64 | 64 | ||
65 | 65 | ||
66 | static void | 66 | static void |
67 | do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 67 | do_stop (void *cls, |
68 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
68 | { | 69 | { |
69 | struct GNUNET_TIME_Relative del; | 70 | struct GNUNET_TIME_Relative del; |
70 | char *fancy; | 71 | char *fancy; |
71 | 72 | ||
72 | GNUNET_SCHEDULER_shutdown (); | 73 | GNUNET_SCHEDULER_shutdown (); |
73 | if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT)) | 74 | if (0 == |
75 | GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_add (start_time, | ||
76 | TIMEOUT)).rel_value_us) | ||
77 | { | ||
78 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
79 | "Timeout during download, shutting down with error\n"); | ||
80 | ok = 1; | ||
81 | } | ||
82 | else | ||
74 | { | 83 | { |
75 | del = GNUNET_TIME_absolute_get_duration (start_time); | 84 | del = GNUNET_TIME_absolute_get_duration (start_time); |
76 | if (del.rel_value_us == 0) | 85 | if (del.rel_value_us == 0) |
@@ -78,16 +87,13 @@ do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
78 | fancy = | 87 | fancy = |
79 | GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * | 88 | GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * |
80 | 1000000LL / del.rel_value_us); | 89 | 1000000LL / del.rel_value_us); |
81 | FPRINTF (stdout, "Download speed was %s/s\n", fancy); | 90 | FPRINTF (stdout, |
91 | "Download speed was %s/s\n", | ||
92 | fancy); | ||
82 | GNUNET_free (fancy); | 93 | GNUNET_free (fancy); |
83 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", | ||
84 | (unsigned long long) FILESIZE); | ||
85 | } | ||
86 | else | ||
87 | { | ||
88 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 94 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
89 | "Timeout during download, shutting down with error\n"); | 95 | "Finished download, shutting down\n", |
90 | ok = 1; | 96 | (unsigned long long) FILESIZE); |
91 | } | 97 | } |
92 | } | 98 | } |
93 | 99 | ||
@@ -110,34 +116,45 @@ do_download (void *cls, | |||
110 | if (NULL != emsg) | 116 | if (NULL != emsg) |
111 | { | 117 | { |
112 | GNUNET_SCHEDULER_shutdown (); | 118 | GNUNET_SCHEDULER_shutdown (); |
113 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to stop source daemon: %s\n", | 119 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
120 | "Failed to stop source daemon: %s\n", | ||
114 | emsg); | 121 | emsg); |
115 | GNUNET_FS_uri_destroy (uri); | 122 | GNUNET_FS_uri_destroy (uri); |
116 | ok = 1; | 123 | ok = 1; |
117 | return; | 124 | return; |
118 | } | 125 | } |
119 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Downloading %llu bytes\n", | 126 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
127 | "Downloading %llu bytes\n", | ||
120 | (unsigned long long) FILESIZE); | 128 | (unsigned long long) FILESIZE); |
121 | start_time = GNUNET_TIME_absolute_get (); | 129 | start_time = GNUNET_TIME_absolute_get (); |
122 | GNUNET_FS_TEST_download (daemons[0], TIMEOUT, 1, SEED, uri, VERBOSE, &do_stop, | 130 | GNUNET_FS_TEST_download (daemons[0], |
131 | TIMEOUT, | ||
132 | 1, | ||
133 | SEED, | ||
134 | uri, | ||
135 | VERBOSE, | ||
136 | &do_stop, | ||
123 | NULL); | 137 | NULL); |
124 | GNUNET_FS_uri_destroy (uri); | 138 | GNUNET_FS_uri_destroy (uri); |
125 | } | 139 | } |
126 | 140 | ||
127 | 141 | ||
128 | static void | 142 | static void |
129 | stop_source_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 143 | stop_source_peer (void *cls, |
144 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
130 | { | 145 | { |
131 | struct DownloadContext *dc = cls; | 146 | struct DownloadContext *dc = cls; |
132 | 147 | ||
133 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping source peer\n"); | 148 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
149 | "Stopping source peer\n"); | ||
134 | op = GNUNET_TESTBED_peer_stop (NULL, daemons[1], &do_download, dc); | 150 | op = GNUNET_TESTBED_peer_stop (NULL, daemons[1], &do_download, dc); |
135 | GNUNET_assert (NULL != op); | 151 | GNUNET_assert (NULL != op); |
136 | } | 152 | } |
137 | 153 | ||
138 | 154 | ||
139 | static void | 155 | static void |
140 | do_wait (void *cls, const struct GNUNET_FS_Uri *uri, | 156 | do_wait (void *cls, |
157 | const struct GNUNET_FS_Uri *uri, | ||
141 | const char *fn) | 158 | const char *fn) |
142 | { | 159 | { |
143 | struct DownloadContext *dc; | 160 | struct DownloadContext *dc; |
@@ -150,7 +167,8 @@ do_wait (void *cls, const struct GNUNET_FS_Uri *uri, | |||
150 | ok = 1; | 167 | ok = 1; |
151 | return; | 168 | return; |
152 | } | 169 | } |
153 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Waiting to allow content to migrate\n"); | 170 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
171 | "Waiting to allow content to migrate\n"); | ||
154 | dc = GNUNET_new (struct DownloadContext); | 172 | dc = GNUNET_new (struct DownloadContext); |
155 | dc->uri = GNUNET_FS_uri_dup (uri); | 173 | dc->uri = GNUNET_FS_uri_dup (uri); |
156 | if (NULL != fn) | 174 | if (NULL != fn) |
@@ -172,7 +190,8 @@ do_publish (void *cls, | |||
172 | GNUNET_assert (2 == num_peers); | 190 | GNUNET_assert (2 == num_peers); |
173 | for (i=0;i<num_peers;i++) | 191 | for (i=0;i<num_peers;i++) |
174 | daemons[i] = peers[i]; | 192 | daemons[i] = peers[i]; |
175 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Publishing %llu bytes\n", | 193 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
194 | "Publishing %llu bytes\n", | ||
176 | (unsigned long long) FILESIZE); | 195 | (unsigned long long) FILESIZE); |
177 | GNUNET_FS_TEST_publish (daemons[1], TIMEOUT, 1, GNUNET_NO, FILESIZE, SEED, | 196 | GNUNET_FS_TEST_publish (daemons[1], TIMEOUT, 1, GNUNET_NO, FILESIZE, SEED, |
178 | VERBOSE, &do_wait, NULL); | 197 | VERBOSE, &do_wait, NULL); |
@@ -180,7 +199,8 @@ do_publish (void *cls, | |||
180 | 199 | ||
181 | 200 | ||
182 | int | 201 | int |
183 | main (int argc, char *argv[]) | 202 | main (int argc, |
203 | char *argv[]) | ||
184 | { | 204 | { |
185 | (void) GNUNET_TESTBED_test_run ("test-gnunet-service-fs-migration", | 205 | (void) GNUNET_TESTBED_test_run ("test-gnunet-service-fs-migration", |
186 | "fs_test_lib_data.conf", | 206 | "fs_test_lib_data.conf", |
diff --git a/src/fs/test_gnunet_service_fs_p2p.c b/src/fs/test_gnunet_service_fs_p2p.c index ba3b8daab..57efbdcd6 100644 --- a/src/fs/test_gnunet_service_fs_p2p.c +++ b/src/fs/test_gnunet_service_fs_p2p.c | |||
@@ -61,24 +61,29 @@ do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
61 | char *fancy; | 61 | char *fancy; |
62 | 62 | ||
63 | GNUNET_SCHEDULER_shutdown (); | 63 | GNUNET_SCHEDULER_shutdown (); |
64 | if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT)) | 64 | if (0 == |
65 | GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_add (start_time, | ||
66 | TIMEOUT)).rel_value_us) | ||
67 | { | ||
68 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
69 | "Timeout during download, shutting down with error\n"); | ||
70 | ok = 1; | ||
71 | } | ||
72 | else | ||
65 | { | 73 | { |
66 | del = GNUNET_TIME_absolute_get_duration (start_time); | 74 | del = GNUNET_TIME_absolute_get_duration (start_time); |
67 | if (del.rel_value_us == 0) | 75 | if (0 == del.rel_value_us) |
68 | del.rel_value_us = 1; | 76 | del.rel_value_us = 1; |
69 | fancy = | 77 | fancy = |
70 | GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * | 78 | GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * |
71 | 1000000LL / del.rel_value_us); | 79 | 1000000LL / del.rel_value_us); |
72 | FPRINTF (stdout, "Download speed was %s/s\n", fancy); | 80 | FPRINTF (stdout, |
81 | "Download speed was %s/s\n", | ||
82 | fancy); | ||
73 | GNUNET_free (fancy); | 83 | GNUNET_free (fancy); |
74 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", | ||
75 | (unsigned long long) FILESIZE); | ||
76 | } | ||
77 | else | ||
78 | { | ||
79 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 84 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
80 | "Timeout during download, shutting down with error\n"); | 85 | "Finished download, shutting down\n", |
81 | ok = 1; | 86 | (unsigned long long) FILESIZE); |
82 | } | 87 | } |
83 | if (NULL != fn) | 88 | if (NULL != fn) |
84 | { | 89 | { |