GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
+ by the Free Software Foundation; either version 3, or (at your
option) any later version.
GNUnet is distributed in the hope that it will be useful, but
#define START_ARM GNUNET_YES
-#define START_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 50)
+#define START_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 500)
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15)
static void
arm_stopped (void *cls, int success)
{
- if (success != GNUNET_NO)
- ok = 1;
- else
+ if (success != GNUNET_NO)
+ ok = 3;
+ else if (ok == 1)
ok = 0;
}
{
if (addr == NULL)
{
- GNUNET_assert (ok == 0);
+ if (ok != 0)
+ {
+ GNUNET_break (0);
+ ok = 2;
+ }
GNUNET_ARM_stop_service (arm, "resolver", TIMEOUT, &arm_notify_stop, NULL);
return;
}
static void
resolver_notify (void *cls, int success)
{
- GNUNET_assert (success == GNUNET_YES);
+ if (success != GNUNET_YES)
+ {
+ GNUNET_break (0);
+ ok = 2;
+#if START_ARM
+ GNUNET_ARM_stop_service (arm, "arm", TIMEOUT, &arm_stopped, NULL);
+#endif
+ return;
+ }
GNUNET_RESOLVER_ip_get (sched,
cfg,
"localhost", AF_INET, TIMEOUT, &dns_notify, NULL);
static void
arm_notify (void *cls, int success)
{
- GNUNET_assert (success == GNUNET_YES);
+ if (success != GNUNET_YES)
+ {
+ GNUNET_break (0);
+ ok = 2;
+#if START_ARM
+ GNUNET_ARM_stop_service (arm, "arm", TIMEOUT, &arm_stopped, NULL);
+#endif
+ }
GNUNET_ARM_start_service (arm, "resolver", START_TIMEOUT, &resolver_notify, NULL);
}