diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-11-05 18:21:50 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-11-05 18:21:50 +0000 |
commit | 75a33a1499cf60ea4364c9aa673816629a6c1413 (patch) | |
tree | 0620da4312bb04de4d7b65074fdd3b0c3dd6cc0e /src/fs/test_fs_unindex.c | |
parent | 7217c601ad30760872823193d62307e7a335d226 (diff) | |
download | gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.tar.gz gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.zip |
big scheduler refactoring, expect some issues
Diffstat (limited to 'src/fs/test_fs_unindex.c')
-rw-r--r-- | src/fs/test_fs_unindex.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c index 7adc4d229..e2c0e86ee 100644 --- a/src/fs/test_fs_unindex.c +++ b/src/fs/test_fs_unindex.c | |||
@@ -60,8 +60,6 @@ static struct PeerContext p1; | |||
60 | 60 | ||
61 | static struct GNUNET_TIME_Absolute start; | 61 | static struct GNUNET_TIME_Absolute start; |
62 | 62 | ||
63 | static struct GNUNET_SCHEDULER_Handle *sched; | ||
64 | |||
65 | static struct GNUNET_FS_Handle *fs; | 63 | static struct GNUNET_FS_Handle *fs; |
66 | 64 | ||
67 | static struct GNUNET_FS_UnindexContext *unindex; | 65 | static struct GNUNET_FS_UnindexContext *unindex; |
@@ -120,8 +118,7 @@ progress_cb (void *cls, | |||
120 | case GNUNET_FS_STATUS_UNINDEX_COMPLETED: | 118 | case GNUNET_FS_STATUS_UNINDEX_COMPLETED: |
121 | printf ("Unindex complete, %llu kbps.\n", | 119 | printf ("Unindex complete, %llu kbps.\n", |
122 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); | 120 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); |
123 | GNUNET_SCHEDULER_add_continuation (sched, | 121 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, |
124 | &abort_unindex_task, | ||
125 | NULL, | 122 | NULL, |
126 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 123 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
127 | break; | 124 | break; |
@@ -140,8 +137,7 @@ progress_cb (void *cls, | |||
140 | "Error publishing file: %s\n", | 137 | "Error publishing file: %s\n", |
141 | event->value.publish.specifics.error.message); | 138 | event->value.publish.specifics.error.message); |
142 | GNUNET_break (0); | 139 | GNUNET_break (0); |
143 | GNUNET_SCHEDULER_add_continuation (sched, | 140 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, |
144 | &abort_publish_task, | ||
145 | NULL, | 141 | NULL, |
146 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 142 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
147 | break; | 143 | break; |
@@ -149,8 +145,7 @@ progress_cb (void *cls, | |||
149 | fprintf (stderr, | 145 | fprintf (stderr, |
150 | "Error unindexing file: %s\n", | 146 | "Error unindexing file: %s\n", |
151 | event->value.unindex.specifics.error.message); | 147 | event->value.unindex.specifics.error.message); |
152 | GNUNET_SCHEDULER_add_continuation (sched, | 148 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, |
153 | &abort_unindex_task, | ||
154 | NULL, | 149 | NULL, |
155 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 150 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
156 | break; | 151 | break; |
@@ -177,8 +172,7 @@ progress_cb (void *cls, | |||
177 | break; | 172 | break; |
178 | case GNUNET_FS_STATUS_UNINDEX_STOPPED: | 173 | case GNUNET_FS_STATUS_UNINDEX_STOPPED: |
179 | GNUNET_assert (unindex == event->value.unindex.uc); | 174 | GNUNET_assert (unindex == event->value.unindex.uc); |
180 | GNUNET_SCHEDULER_add_continuation (sched, | 175 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, |
181 | &abort_publish_task, | ||
182 | NULL, | 176 | NULL, |
183 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 177 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
184 | break; | 178 | break; |
@@ -226,7 +220,6 @@ stop_arm (struct PeerContext *p) | |||
226 | 220 | ||
227 | static void | 221 | static void |
228 | run (void *cls, | 222 | run (void *cls, |
229 | struct GNUNET_SCHEDULER_Handle *s, | ||
230 | char *const *args, | 223 | char *const *args, |
231 | const char *cfgfile, | 224 | const char *cfgfile, |
232 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 225 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
@@ -241,11 +234,9 @@ run (void *cls, | |||
241 | struct GNUNET_FS_FileInformation *fi; | 234 | struct GNUNET_FS_FileInformation *fi; |
242 | size_t i; | 235 | size_t i; |
243 | 236 | ||
244 | sched = s; | ||
245 | setup_peer (&p1, "test_fs_unindex_data.conf"); | 237 | setup_peer (&p1, "test_fs_unindex_data.conf"); |
246 | fn = GNUNET_DISK_mktemp ("gnunet-unindex-test-dst"); | 238 | fn = GNUNET_DISK_mktemp ("gnunet-unindex-test-dst"); |
247 | fs = GNUNET_FS_start (sched, | 239 | fs = GNUNET_FS_start (cfg, |
248 | cfg, | ||
249 | "test-fs-unindex", | 240 | "test-fs-unindex", |
250 | &progress_cb, | 241 | &progress_cb, |
251 | NULL, | 242 | NULL, |