aboutsummaryrefslogtreecommitdiff
path: root/src/fs/test_fs_download.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/test_fs_download.c')
-rw-r--r--src/fs/test_fs_download.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c
index ffb90d678..730720d40 100644
--- a/src/fs/test_fs_download.c
+++ b/src/fs/test_fs_download.c
@@ -96,17 +96,22 @@ progress_cb (void *cls,
96 { 96 {
97 case GNUNET_FS_STATUS_PUBLISH_PROGRESS: 97 case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
98#if DEBUG_VERBOSE 98#if DEBUG_VERBOSE
99 printf ("Publish is progressing (%llu/%llu)...\n", 99 printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n",
100 (unsigned long long) event->value.publish.completed, 100 (unsigned long long) event->value.publish.completed,
101 (unsigned long long) event->value.publish.size); 101 (unsigned long long) event->value.publish.size,
102 event->value.publish.specifics.progress.depth,
103 (unsigned long long) event->value.publish.specifics.progress.offset);
102#endif 104#endif
103 break; 105 break;
104 case GNUNET_FS_STATUS_PUBLISH_COMPLETED: 106 case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
105#if DEBUG_VERBOSE 107#if DEBUG_VERBOSE
106 printf ("Publish complete.\n"); 108 printf ("Publish complete.\n");
107#endif 109#endif
108 GNUNET_FS_publish_stop (publish); 110 GNUNET_SCHEDULER_add_continuation (sched,
109 publish = NULL; 111 GNUNET_NO,
112 &abort_publish_task,
113 NULL,
114 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
110 fn = GNUNET_DISK_mktemp ("gnunet-download-test-dstXXXXXX"); 115 fn = GNUNET_DISK_mktemp ("gnunet-download-test-dstXXXXXX");
111 download = GNUNET_FS_download_start (fs, 116 download = GNUNET_FS_download_start (fs,
112 event->value.publish.specifics.completed.chk_uri, 117 event->value.publish.specifics.completed.chk_uri,
@@ -123,14 +128,19 @@ progress_cb (void *cls,
123#if DEBUG_VERBOSE 128#if DEBUG_VERBOSE
124 printf ("Download complete.\n"); 129 printf ("Download complete.\n");
125#endif 130#endif
126 GNUNET_FS_download_stop (download, GNUNET_YES); 131 GNUNET_SCHEDULER_add_continuation (sched,
127 download = NULL; 132 GNUNET_NO,
133 &abort_download_task,
134 NULL,
135 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
128 break; 136 break;
129 case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: 137 case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS:
130#if DEBUG_VERBOSE 138#if DEBUG_VERBOSE
131 printf ("Download is progressing (%llu/%llu)...\n", 139 printf ("Download is progressing (%llu/%llu at level %u off %llu)...\n",
132 (unsigned long long) event->value.download.completed, 140 (unsigned long long) event->value.download.completed,
133 (unsigned long long) event->value.download.size); 141 (unsigned long long) event->value.download.size,
142 event->value.download.specifics.progress.depth,
143 (unsigned long long) event->value.download.specifics.progress.offset);
134#endif 144#endif
135 break; 145 break;
136 case GNUNET_FS_STATUS_PUBLISH_ERROR: 146 case GNUNET_FS_STATUS_PUBLISH_ERROR: