}
for (i = 0; i < ctx->num_peers; i++)
if (op == ctx->ops[i])
+ {
ctx->meshes[i] = ca_result;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "...mesh %u connected\n", i);
+ }
for (i = 0; i < ctx->num_peers; i++)
if (NULL == ctx->meshes[i])
return; /* still some MESH connections missing */
struct GNUNET_MESH_TEST_Context *ctx = cls;
unsigned int i;
- GNUNET_assert (num_peers == ctx->num_peers);
+ if (num_peers != ctx->num_peers)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peers started %u/%u, ending\n",
+ num_peers, ctx->num_peers);
+ exit (1);
+ }
ctx->peers = peers;
for (i = 0; i < num_peers; i++)
{
struct GNUNET_MESH_TEST_AdapterContext *newctx;
- newctx = GNUNET_malloc (sizeof (struct GNUNET_MESH_TEST_AdapterContext));
+ newctx = GNUNET_new (struct GNUNET_MESH_TEST_AdapterContext);
newctx->peer = i;
newctx->ctx = ctx;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Connecting to mesh %u\n", i);
ctx->ops[i] = GNUNET_TESTBED_service_connect (ctx,
peers[i],
"mesh",
&mesh_connect_adapter,
&mesh_disconnect_adapter,
newctx);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "op handle %p\n", ctx->ops[i]);
}
}
{
struct GNUNET_MESH_TEST_Context *ctx;
- ctx = GNUNET_malloc (sizeof (struct GNUNET_MESH_TEST_Context));
+ ctx = GNUNET_new (struct GNUNET_MESH_TEST_Context);
ctx->num_peers = num_peers;
ctx->ops = GNUNET_malloc (num_peers * sizeof (struct GNUNET_TESTBED_Operation *));
ctx->meshes = GNUNET_malloc (num_peers * sizeof (struct GNUNET_MESH_Handle *));