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/peerinfo/gnunet-service-peerinfo.c | |
parent | 7217c601ad30760872823193d62307e7a335d226 (diff) | |
download | gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.tar.gz gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.zip |
big scheduler refactoring, expect some issues
Diffstat (limited to 'src/peerinfo/gnunet-service-peerinfo.c')
-rw-r--r-- | src/peerinfo/gnunet-service-peerinfo.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c index 698c7dc30..31b0199f4 100644 --- a/src/peerinfo/gnunet-service-peerinfo.c +++ b/src/peerinfo/gnunet-service-peerinfo.c | |||
@@ -311,8 +311,7 @@ cron_scan_directory_data_hosts (void *cls, | |||
311 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING | | 311 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING | |
312 | GNUNET_ERROR_TYPE_BULK, | 312 | GNUNET_ERROR_TYPE_BULK, |
313 | _("Still no peers found in `%s'!\n"), networkIdDirectory); | 313 | _("Still no peers found in `%s'!\n"), networkIdDirectory); |
314 | GNUNET_SCHEDULER_add_delayed (tc->sched, | 314 | GNUNET_SCHEDULER_add_delayed (DATA_HOST_FREQ, |
315 | DATA_HOST_FREQ, | ||
316 | &cron_scan_directory_data_hosts, NULL); | 315 | &cron_scan_directory_data_hosts, NULL); |
317 | } | 316 | } |
318 | 317 | ||
@@ -464,8 +463,7 @@ cron_clean_data_hosts (void *cls, | |||
464 | now = GNUNET_TIME_absolute_get (); | 463 | now = GNUNET_TIME_absolute_get (); |
465 | GNUNET_DISK_directory_scan (networkIdDirectory, | 464 | GNUNET_DISK_directory_scan (networkIdDirectory, |
466 | &discard_hosts_helper, &now); | 465 | &discard_hosts_helper, &now); |
467 | GNUNET_SCHEDULER_add_delayed (tc->sched, | 466 | GNUNET_SCHEDULER_add_delayed (DATA_HOST_CLEAN_FREQ, |
468 | DATA_HOST_CLEAN_FREQ, | ||
469 | &cron_clean_data_hosts, NULL); | 467 | &cron_clean_data_hosts, NULL); |
470 | } | 468 | } |
471 | 469 | ||
@@ -650,13 +648,11 @@ shutdown_task (void *cls, | |||
650 | * Process statistics requests. | 648 | * Process statistics requests. |
651 | * | 649 | * |
652 | * @param cls closure | 650 | * @param cls closure |
653 | * @param sched scheduler to use | ||
654 | * @param server the initialized server | 651 | * @param server the initialized server |
655 | * @param cfg configuration to use | 652 | * @param cfg configuration to use |
656 | */ | 653 | */ |
657 | static void | 654 | static void |
658 | run (void *cls, | 655 | run (void *cls, |
659 | struct GNUNET_SCHEDULER_Handle *sched, | ||
660 | struct GNUNET_SERVER_Handle *server, | 656 | struct GNUNET_SERVER_Handle *server, |
661 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 657 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
662 | { | 658 | { |
@@ -672,7 +668,7 @@ run (void *cls, | |||
672 | }; | 668 | }; |
673 | 669 | ||
674 | hostmap = GNUNET_CONTAINER_multihashmap_create (1024); | 670 | hostmap = GNUNET_CONTAINER_multihashmap_create (1024); |
675 | stats = GNUNET_STATISTICS_create (sched, "peerinfo", cfg); | 671 | stats = GNUNET_STATISTICS_create ("peerinfo", cfg); |
676 | notify_list = GNUNET_SERVER_notification_context_create (server, 0); | 672 | notify_list = GNUNET_SERVER_notification_context_create (server, 0); |
677 | GNUNET_assert (GNUNET_OK == | 673 | GNUNET_assert (GNUNET_OK == |
678 | GNUNET_CONFIGURATION_get_value_filename (cfg, | 674 | GNUNET_CONFIGURATION_get_value_filename (cfg, |
@@ -680,14 +676,11 @@ run (void *cls, | |||
680 | "HOSTS", | 676 | "HOSTS", |
681 | &networkIdDirectory)); | 677 | &networkIdDirectory)); |
682 | GNUNET_DISK_directory_create (networkIdDirectory); | 678 | GNUNET_DISK_directory_create (networkIdDirectory); |
683 | GNUNET_SCHEDULER_add_with_priority (sched, | 679 | GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE, |
684 | GNUNET_SCHEDULER_PRIORITY_IDLE, | ||
685 | &cron_scan_directory_data_hosts, NULL); | 680 | &cron_scan_directory_data_hosts, NULL); |
686 | GNUNET_SCHEDULER_add_with_priority (sched, | 681 | GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE, |
687 | GNUNET_SCHEDULER_PRIORITY_IDLE, | ||
688 | &cron_clean_data_hosts, NULL); | 682 | &cron_clean_data_hosts, NULL); |
689 | GNUNET_SCHEDULER_add_delayed (sched, | 683 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
690 | GNUNET_TIME_UNIT_FOREVER_REL, | ||
691 | &shutdown_task, NULL); | 684 | &shutdown_task, NULL); |
692 | GNUNET_SERVER_add_handlers (server, handlers); | 685 | GNUNET_SERVER_add_handlers (server, handlers); |
693 | } | 686 | } |