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
* How many peers are being started right now?
*/
unsigned int starting;
+
+ /**
+ * How many peers have already been started?
+ */
+ unsigned int started;
};
struct UpdateContext
return GNUNET_NO;
while (topology_strings[curr] != NULL)
{
- if (strcmp(topology_strings[curr], topology_string) == 0)
+ if (strcasecmp(topology_strings[curr], topology_string) == 0)
{
*topology = curr;
return GNUNET_YES;
* topology option, GNUNET_NO if not
*/
int
-GNUNET_TESTING_topology_option_get(enum GNUNET_TESTING_TopologyOption *topology_option,
- char * topology_string)
+GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption *topology_option,
+ char * topology_string)
{
/**
* Options for connecting a topology as strings.
return GNUNET_NO;
while (NULL != topology_option_strings[curr])
{
- if (strcmp(topology_option_strings[curr], topology_string) == 0)
+ if (strcasecmp(topology_option_strings[curr], topology_string) == 0)
{
*topology_option = curr;
return GNUNET_YES;
{
struct InternalStartContext *internal_context = cls;
internal_context->peer->pg->starting--;
- internal_context->hostkey_callback(internal_context->hostkey_cls, id, d, emsg);
+ internal_context->peer->pg->started++;
+ if (internal_context->hostkey_callback != NULL)
+ internal_context->hostkey_callback(internal_context->hostkey_cls, id, d, emsg);
+ else if (internal_context->peer->pg->started == internal_context->peer->pg->total)
+ {
+ internal_context->peer->pg->started = 0; /* Internal startup may use this counter! */
+ GNUNET_TESTING_daemons_continue_startup(internal_context->peer->pg);
+ }
}
/**
{
struct InternalStartContext *internal_context = cls;
internal_context->peer->pg->starting--;
- internal_context->start_cb(internal_context->start_cb_cls, id, cfg, d, emsg);
+ if (internal_context->start_cb != NULL)
+ internal_context->start_cb(internal_context->start_cb_cls, id, cfg, d, emsg);
}
static void
shutdown_cb = NULL;
shutdown_ctx = NULL;
- if ((cb != NULL) && (pg->total > 0))
+ if (cb != NULL)
{
shutdown_ctx = GNUNET_malloc(sizeof(struct ShutdownContext));
shutdown_ctx->cb = cb;