static void
arm_stopped (void *cls, int success)
{
- if (success != GNUNET_NO)
+ if (success != GNUNET_NO)
ok = 3;
else if (ok == 1)
ok = 0;
dns_notify (void *cls, const struct sockaddr *addr, socklen_t addrlen)
{
if (addr == NULL)
+ {
+ if (ok != 0)
{
- if (ok != 0)
- {
- GNUNET_break (0);
- ok = 2;
- }
- GNUNET_ARM_stop_service (arm, "resolver", TIMEOUT, &arm_notify_stop, NULL);
- return;
+ GNUNET_break (0);
+ ok = 2;
}
+ GNUNET_ARM_stop_service (arm, "resolver", TIMEOUT, &arm_notify_stop, NULL);
+ return;
+ }
GNUNET_assert (addr != NULL);
ok = 0;
}
resolver_notify (void *cls, int success)
{
if (success != GNUNET_YES)
- {
- GNUNET_break (0);
- ok = 2;
+ {
+ GNUNET_break (0);
+ ok = 2;
#if START_ARM
- GNUNET_ARM_stop_service (arm, "arm", TIMEOUT, &arm_stopped, NULL);
+ GNUNET_ARM_stop_service (arm, "arm", TIMEOUT, &arm_stopped, NULL);
#endif
- return;
- }
+ return;
+ }
GNUNET_RESOLVER_ip_get ("localhost", AF_INET, TIMEOUT, &dns_notify, NULL);
}
arm_notify (void *cls, int success)
{
if (success != GNUNET_YES)
- {
- GNUNET_break (0);
- ok = 2;
+ {
+ GNUNET_break (0);
+ ok = 2;
#if START_ARM
- GNUNET_ARM_stop_service (arm, "arm", TIMEOUT, &arm_stopped, NULL);
+ GNUNET_ARM_stop_service (arm, "arm", TIMEOUT, &arm_stopped, NULL);
#endif
- }
- GNUNET_ARM_start_service (arm, "resolver", START_TIMEOUT, &resolver_notify, NULL);
+ }
+ GNUNET_ARM_start_service (arm, "resolver", START_TIMEOUT, &resolver_notify,
+ NULL);
}
static void
-task (void *cls,
- char *const *args,
- const char *cfgfile,
+task (void *cls, char *const *args, const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *c)
{
cfg = c;
};
GNUNET_assert (GNUNET_OK ==
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
- argv,
- "test-arm-api",
- "nohelp", options, &task, NULL));
+ argv, "test-arm-api", "nohelp", options,
+ &task, NULL));
return ok;
}