aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-publish.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-11-05 18:21:50 +0000
committerNathan S. Evans <evans@in.tum.de>2010-11-05 18:21:50 +0000
commit75a33a1499cf60ea4364c9aa673816629a6c1413 (patch)
tree0620da4312bb04de4d7b65074fdd3b0c3dd6cc0e /src/fs/gnunet-publish.c
parent7217c601ad30760872823193d62307e7a335d226 (diff)
downloadgnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.tar.gz
gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.zip
big scheduler refactoring, expect some issues
Diffstat (limited to 'src/fs/gnunet-publish.c')
-rw-r--r--src/fs/gnunet-publish.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index 79beacc84..36e75a4ea 100644
--- a/src/fs/gnunet-publish.c
+++ b/src/fs/gnunet-publish.c
@@ -38,8 +38,6 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
38 38
39static struct GNUNET_FS_Handle *ctx; 39static struct GNUNET_FS_Handle *ctx;
40 40
41static struct GNUNET_SCHEDULER_Handle *sched;
42
43static struct GNUNET_FS_PublishContext *pc; 41static struct GNUNET_FS_PublishContext *pc;
44 42
45static struct GNUNET_CONTAINER_MetaData *meta; 43static struct GNUNET_CONTAINER_MetaData *meta;
@@ -135,12 +133,10 @@ progress_cb (void *cls,
135 info->value.publish.specifics.error.message); 133 info->value.publish.specifics.error.message);
136 if (kill_task != GNUNET_SCHEDULER_NO_TASK) 134 if (kill_task != GNUNET_SCHEDULER_NO_TASK)
137 { 135 {
138 GNUNET_SCHEDULER_cancel (sched, 136 GNUNET_SCHEDULER_cancel (kill_task);
139 kill_task);
140 kill_task = GNUNET_SCHEDULER_NO_TASK; 137 kill_task = GNUNET_SCHEDULER_NO_TASK;
141 } 138 }
142 GNUNET_SCHEDULER_add_continuation (sched, 139 GNUNET_SCHEDULER_add_continuation (&do_stop_task,
143 &do_stop_task,
144 NULL, 140 NULL,
145 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 141 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
146 break; 142 break;
@@ -157,12 +153,10 @@ progress_cb (void *cls,
157 { 153 {
158 if (kill_task != GNUNET_SCHEDULER_NO_TASK) 154 if (kill_task != GNUNET_SCHEDULER_NO_TASK)
159 { 155 {
160 GNUNET_SCHEDULER_cancel (sched, 156 GNUNET_SCHEDULER_cancel (kill_task);
161 kill_task);
162 kill_task = GNUNET_SCHEDULER_NO_TASK; 157 kill_task = GNUNET_SCHEDULER_NO_TASK;
163 } 158 }
164 GNUNET_SCHEDULER_add_continuation (sched, 159 GNUNET_SCHEDULER_add_continuation (&do_stop_task,
165 &do_stop_task,
166 NULL, 160 NULL,
167 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 161 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
168 } 162 }
@@ -374,14 +368,12 @@ uri_ksk_continuation (void *cls,
374 * Main function that will be run by the scheduler. 368 * Main function that will be run by the scheduler.
375 * 369 *
376 * @param cls closure 370 * @param cls closure
377 * @param s the scheduler to use
378 * @param args remaining command-line arguments 371 * @param args remaining command-line arguments
379 * @param cfgfile name of the configuration file used (for saving, can be NULL!) 372 * @param cfgfile name of the configuration file used (for saving, can be NULL!)
380 * @param c configuration 373 * @param c configuration
381 */ 374 */
382static void 375static void
383run (void *cls, 376run (void *cls,
384 struct GNUNET_SCHEDULER_Handle *s,
385 char *const *args, 377 char *const *args,
386 const char *cfgfile, 378 const char *cfgfile,
387 const struct GNUNET_CONFIGURATION_Handle *c) 379 const struct GNUNET_CONFIGURATION_Handle *c)
@@ -393,7 +385,6 @@ run (void *cls,
393 char *ex; 385 char *ex;
394 char *emsg; 386 char *emsg;
395 387
396 sched = s;
397 /* check arguments */ 388 /* check arguments */
398 if ((uri_string != NULL) && (extract_only)) 389 if ((uri_string != NULL) && (extract_only))
399 { 390 {
@@ -446,8 +437,7 @@ run (void *cls,
446 } 437 }
447 } 438 }
448 cfg = c; 439 cfg = c;
449 ctx = GNUNET_FS_start (sched, 440 ctx = GNUNET_FS_start (cfg,
450 cfg,
451 "gnunet-publish", 441 "gnunet-publish",
452 &progress_cb, 442 &progress_cb,
453 NULL, 443 NULL,
@@ -600,8 +590,7 @@ run (void *cls,
600 ret = 1; 590 ret = 1;
601 return; 591 return;
602 } 592 }
603 kill_task = GNUNET_SCHEDULER_add_delayed (sched, 593 kill_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
604 GNUNET_TIME_UNIT_FOREVER_REL,
605 &do_stop_task, 594 &do_stop_task,
606 NULL); 595 NULL);
607} 596}