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_publish_persistence.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_publish_persistence.c')
-rw-r--r-- | src/fs/test_fs_publish_persistence.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c index b1260456b..52b2b270e 100644 --- a/src/fs/test_fs_publish_persistence.c +++ b/src/fs/test_fs_publish_persistence.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 const struct GNUNET_CONFIGURATION_Handle *cfg; | 65 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
@@ -101,8 +99,7 @@ restart_fs_task (void *cls, | |||
101 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 99 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
102 | { | 100 | { |
103 | GNUNET_FS_stop (fs); | 101 | GNUNET_FS_stop (fs); |
104 | fs = GNUNET_FS_start (sched, | 102 | fs = GNUNET_FS_start (cfg, |
105 | cfg, | ||
106 | "test-fs-publish-persistence", | 103 | "test-fs-publish-persistence", |
107 | &progress_cb, | 104 | &progress_cb, |
108 | NULL, | 105 | NULL, |
@@ -128,8 +125,7 @@ consider_restart (int ev) | |||
128 | if (prev[i] == ev) | 125 | if (prev[i] == ev) |
129 | return; | 126 | return; |
130 | prev[off++] = ev; | 127 | prev[off++] = ev; |
131 | GNUNET_SCHEDULER_add_with_priority (sched, | 128 | GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_URGENT, |
132 | GNUNET_SCHEDULER_PRIORITY_URGENT, | ||
133 | &restart_fs_task, | 129 | &restart_fs_task, |
134 | NULL); | 130 | NULL); |
135 | } | 131 | } |
@@ -151,8 +147,7 @@ progress_cb (void *cls, | |||
151 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); | 147 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); |
152 | if (0 == strcmp ("publish-context-dir", | 148 | if (0 == strcmp ("publish-context-dir", |
153 | event->value.publish.cctx)) | 149 | event->value.publish.cctx)) |
154 | GNUNET_SCHEDULER_add_continuation (sched, | 150 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, |
155 | &abort_publish_task, | ||
156 | NULL, | 151 | NULL, |
157 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 152 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
158 | break; | 153 | break; |
@@ -187,8 +182,7 @@ progress_cb (void *cls, | |||
187 | err = 1; | 182 | err = 1; |
188 | if (0 == strcmp ("publish-context-dir", | 183 | if (0 == strcmp ("publish-context-dir", |
189 | event->value.publish.cctx)) | 184 | event->value.publish.cctx)) |
190 | GNUNET_SCHEDULER_add_continuation (sched, | 185 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, |
191 | &abort_publish_task, | ||
192 | NULL, | 186 | NULL, |
193 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 187 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
194 | break; | 188 | break; |
@@ -273,7 +267,6 @@ stop_arm (struct PeerContext *p) | |||
273 | 267 | ||
274 | static void | 268 | static void |
275 | run (void *cls, | 269 | run (void *cls, |
276 | struct GNUNET_SCHEDULER_Handle *s, | ||
277 | char *const *args, | 270 | char *const *args, |
278 | const char *cfgfile, | 271 | const char *cfgfile, |
279 | const struct GNUNET_CONFIGURATION_Handle *c) | 272 | const struct GNUNET_CONFIGURATION_Handle *c) |
@@ -290,11 +283,9 @@ run (void *cls, | |||
290 | struct GNUNET_FS_FileInformation *fidir; | 283 | struct GNUNET_FS_FileInformation *fidir; |
291 | size_t i; | 284 | size_t i; |
292 | 285 | ||
293 | sched = s; | ||
294 | cfg = c; | 286 | cfg = c; |
295 | setup_peer (&p1, "test_fs_publish_data.conf"); | 287 | setup_peer (&p1, "test_fs_publish_data.conf"); |
296 | fs = GNUNET_FS_start (sched, | 288 | fs = GNUNET_FS_start (cfg, |
297 | cfg, | ||
298 | "test-fs-publish-persistence", | 289 | "test-fs-publish-persistence", |
299 | &progress_cb, | 290 | &progress_cb, |
300 | NULL, | 291 | NULL, |