From 75a33a1499cf60ea4364c9aa673816629a6c1413 Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Fri, 5 Nov 2010 18:21:50 +0000 Subject: big scheduler refactoring, expect some issues --- src/fs/gnunet-download.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/fs/gnunet-download.c') diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c index 36681e407..99ebb1435 100644 --- a/src/fs/gnunet-download.c +++ b/src/fs/gnunet-download.c @@ -38,8 +38,6 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg; static struct GNUNET_FS_Handle *ctx; -static struct GNUNET_SCHEDULER_Handle *sched; - static struct GNUNET_FS_DownloadContext *dc; static unsigned int anonymity = 1; @@ -122,7 +120,7 @@ progress_cb (void *cls, fprintf (stderr, _("Error downloading: %s.\n"), info->value.download.specifics.error.message); - GNUNET_SCHEDULER_shutdown (sched); + GNUNET_SCHEDULER_shutdown (); break; case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: s = GNUNET_STRINGS_byte_size_fancy(info->value.download.completed * 1000 / (info->value.download.duration.rel_value + 1)); @@ -132,12 +130,11 @@ progress_cb (void *cls, s); GNUNET_free (s); if (info->value.download.dc == dc) - GNUNET_SCHEDULER_shutdown (sched); + GNUNET_SCHEDULER_shutdown (); break; case GNUNET_FS_STATUS_DOWNLOAD_STOPPED: if (info->value.download.dc == dc) - GNUNET_SCHEDULER_add_continuation (sched, - &cleanup_task, + GNUNET_SCHEDULER_add_continuation (&cleanup_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; @@ -158,14 +155,12 @@ progress_cb (void *cls, * Main function that will be run by the scheduler. * * @param cls closure - * @param s the scheduler to use * @param args remaining command-line arguments * @param cfgfile name of the configuration file used (for saving, can be NULL!) * @param c configuration */ static void run (void *cls, - struct GNUNET_SCHEDULER_Handle *s, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) @@ -174,7 +169,6 @@ run (void *cls, char *emsg; enum GNUNET_FS_DownloadOptions options; - sched = s; uri = GNUNET_FS_uri_parse (args[0], &emsg); if (NULL == uri) @@ -204,8 +198,7 @@ run (void *cls, return; } cfg = c; - ctx = GNUNET_FS_start (sched, - cfg, + ctx = GNUNET_FS_start (cfg, "gnunet-download", &progress_cb, NULL, @@ -246,8 +239,7 @@ run (void *cls, ctx = NULL; return; } - GNUNET_SCHEDULER_add_delayed (sched, - GNUNET_TIME_UNIT_FOREVER_REL, + GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, NULL); } -- cgit v1.2.3