aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/gnunet-transport.c')
-rw-r--r--src/transport/gnunet-transport.c48
1 files changed, 34 insertions, 14 deletions
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c
index c727a6fec..42b7f6062 100644
--- a/src/transport/gnunet-transport.c
+++ b/src/transport/gnunet-transport.c
@@ -607,24 +607,18 @@ shutdown_task (void *cls,
607 } 607 }
608} 608}
609 609
610
611
612/**
613 * Main function that will be run by the scheduler.
614 *
615 * @param cls closure
616 * @param args remaining command-line arguments
617 * @param cfgfile name of the configuration file used (for saving, can be NULL!)
618 * @param cfg configuration
619 */
620static void 610static void
621run (void *cls, char *const *args, const char *cfgfile, 611testservice_task (void *cls,
622 const struct GNUNET_CONFIGURATION_Handle *cfg) 612 const struct GNUNET_SCHEDULER_TaskContext *tc)
623{ 613{
624 if (test_configuration) 614 struct GNUNET_CONFIGURATION_Handle *cfg = cls;
615
616 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT))
625 { 617 {
626 do_test_configuration (cfg); 618 FPRINTF (stderr, _("Service `%s' is not running\n"), "transport");
619 return;
627 } 620 }
621
628 if (benchmark_send && (NULL == cpid)) 622 if (benchmark_send && (NULL == cpid))
629 { 623 {
630 FPRINTF (stderr, _("Option `%s' makes no sense without option `%s'.\n"), 624 FPRINTF (stderr, _("Option `%s' makes no sense without option `%s'.\n"),
@@ -684,6 +678,32 @@ run (void *cls, char *const *args, const char *cfgfile,
684 NULL); 678 NULL);
685 } 679 }
686 } 680 }
681
682
683}
684
685
686/**
687 * Main function that will be run by the scheduler.
688 *
689 * @param cls closure
690 * @param args remaining command-line arguments
691 * @param cfgfile name of the configuration file used (for saving, can be NULL!)
692 * @param cfg configuration
693 */
694static void
695run (void *cls, char *const *args, const char *cfgfile,
696 const struct GNUNET_CONFIGURATION_Handle *cfg)
697{
698 if (test_configuration)
699 {
700 do_test_configuration (cfg);
701 }
702
703 GNUNET_CLIENT_service_test ("transport", cfg,
704 GNUNET_TIME_UNIT_SECONDS,
705 &testservice_task,
706 (void *) cfg);
687} 707}
688 708
689 709