}
-
struct StartContext
{
struct GNUNET_SCHEDULER_Handle *sched;
emsg);
return;
}
+ i = 0;
+ while (i < sctx->total)
+ {
+ if (GNUNET_TESTING_daemon_get (sctx->group,
+ i) == d)
+ break;
+ i++;
+ }
+ GNUNET_assert (i < sctx->total);
GNUNET_assert (sctx->have < sctx->total);
- sctx->daemons[sctx->have]->cfg = GNUNET_CONFIGURATION_dup (cfg);
- sctx->daemons[sctx->have]->group = sctx->group;
- sctx->daemons[sctx->have]->daemon = d;
- sctx->daemons[sctx->have]->id = *id;
+ GNUNET_assert (sctx->daemons[i]->cfg == NULL);
+ sctx->daemons[i]->cfg = GNUNET_CONFIGURATION_dup (cfg);
+ sctx->daemons[i]->group = sctx->group;
+ sctx->daemons[i]->daemon = d;
+ sctx->daemons[i]->id = *id;
sctx->have++;
if (sctx->have == sctx->total)
{
GNUNET_SCHEDULER_cancel (sctx->sched,
sctx->timeout_task);
for (i=0;i<sctx->total;i++)
- sctx->daemons[i]->fs = GNUNET_FS_start (sctx->sched,
- sctx->daemons[i]->cfg,
- "<tester>",
- &progress_cb,
- sctx->daemons[i],
- GNUNET_FS_FLAGS_NONE,
- GNUNET_FS_OPTIONS_END);
+ {
+ sctx->daemons[i]->fs = GNUNET_FS_start (sctx->sched,
+ sctx->daemons[i]->cfg,
+ "<tester>",
+ &progress_cb,
+ sctx->daemons[i],
+ GNUNET_FS_FLAGS_NONE,
+ GNUNET_FS_OPTIONS_END);
+ }
GNUNET_free (sctx);
}
}
void *cont_cls;
};
-
+/**
+ * Prototype of a function that will be called whenever
+ * two daemons are connected by the testing library.
+ *
+ * @param cls closure
+ * @param first peer id for first daemon
+ * @param second peer id for the second daemon
+ * @param distance distance between the connected peers
+ * @param first_cfg config for the first daemon
+ * @param second_cfg config for the second daemon
+ * @param first_daemon handle for the first daemon
+ * @param second_daemon handle for the second daemon
+ * @param emsg error message (NULL on success)
+ */
static void
notify_connection (void *cls,
const struct GNUNET_PeerIdentity *first,
const struct GNUNET_PeerIdentity *second,
+ uint32_t distance,
const struct GNUNET_CONFIGURATION_Handle *first_cfg,
const struct GNUNET_CONFIGURATION_Handle *second_cfg,
struct GNUNET_TESTING_Daemon *first_daemon,