/**
* Timeout for stopping services. Long to give some services a real chance.
*/
-#define STOP_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
+#define STOP_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
+
+/**
+ * Timeout for stopping ARM. Extra-long since ARM needs to stop everyone else.
+ */
+#define STOP_TIMEOUT_ARM GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
/**
* Timeout for starting services, very short because of the strange way start works
*/
static struct GNUNET_ARM_Handle *h;
-/**
- * Our scheduler.
- */
-static struct GNUNET_SCHEDULER_Handle *sched;
-
/**
* Our configuration.
*/
break;
}
- GNUNET_SCHEDULER_add_continuation (sched,
- &cps_loop,
+ GNUNET_SCHEDULER_add_continuation (&cps_loop,
NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
}
if (quiet != GNUNET_YES)
fprintf(stdout, _("Service `%s' is not running.\n"), service);
}
- GNUNET_SCHEDULER_add_continuation (sched,
- &cps_loop,
+ GNUNET_SCHEDULER_add_continuation (&cps_loop,
NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
}
* 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)
{
- sched = s;
cfg = c;
config_file = cfgfile;
if (GNUNET_CONFIGURATION_get_value_string(cfg, "PATHS", "SERVICEHOME", &dir) != GNUNET_OK)
"PATHS");
return;
}
- h = GNUNET_ARM_connect (cfg, sched, NULL);
+ h = GNUNET_ARM_connect (cfg, NULL);
if (h == NULL)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
ret = 1;
return;
}
- GNUNET_SCHEDULER_add_continuation (sched,
- &cps_loop,
+ GNUNET_SCHEDULER_add_continuation (&cps_loop,
NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
}
case 1:
if ((end) || (restart))
{
- GNUNET_ARM_stop_service (h, "arm", STOP_TIMEOUT, &confirm_cb, "arm");
+ GNUNET_ARM_stop_service (h, "arm", STOP_TIMEOUT_ARM, &confirm_cb, "arm");
return;
}
break;
case 4:
if (test != NULL)
{
- GNUNET_CLIENT_service_test (sched, test, cfg, TEST_TIMEOUT, &confirm_task, test);
+ GNUNET_CLIENT_service_test (test, cfg, TEST_TIMEOUT, &confirm_task, test);
return;
}
break;
end = 0;
start = 1;
restart = 0;
- h = GNUNET_ARM_connect (cfg, sched, NULL);
+ h = GNUNET_ARM_connect (cfg, NULL);
if (h == NULL)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
ret = 1;
return;
}
- GNUNET_SCHEDULER_add_now(sched, &cps_loop, NULL);
+ GNUNET_SCHEDULER_add_now(&cps_loop, NULL);
return;
}
/* Fall through */