- case STATE_SLAVES_STARTING:
- switch (event->type)
- {
- case GNUNET_TESTBED_ET_OPERATION_FINISHED:
- {
- static unsigned int slaves_started;
- unsigned int peer_cnt;
-
- dll_op = event->details.operation_finished.op_cls;
- GNUNET_CONTAINER_DLL_remove (dll_op_head, dll_op_tail, dll_op);
- GNUNET_free (dll_op);
- op = event->details.operation_finished.operation;
- if (NULL != event->details.operation_finished.emsg)
- {
- LOG (GNUNET_ERROR_TYPE_WARNING,
- _("An operation has failed while starting slaves\n"));
- GNUNET_TESTBED_operation_done (op);
- GNUNET_SCHEDULER_cancel (abort_task);
- abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
- return;
- }
- GNUNET_TESTBED_operation_done (op);
- /* Proceed to start peers */
- if (++slaves_started == num_hosts - 1)
- {
- printf ("All slaves started successfully\n");
- state = STATE_PEERS_CREATING;
- prof_start_time = GNUNET_TIME_absolute_get ();
- peers = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Peer *)
- * num_peers);
- for (peer_cnt = 0; peer_cnt < num_peers; peer_cnt++)
- {
- dll_op = GNUNET_malloc (sizeof (struct DLLOperation));
- dll_op->cls = &peers[peer_cnt];
- dll_op->op = GNUNET_TESTBED_peer_create (mc,
- hosts
- [peer_cnt % num_hosts],
- cfg,
- &peer_create_cb,
- dll_op);
- GNUNET_CONTAINER_DLL_insert_tail (dll_op_head, dll_op_tail, dll_op);
- }
- }
- }
- break;
- default:
- GNUNET_assert (0);
- }
- break;
- case STATE_PEERS_STARTING:
- switch (event->type)
- {
- case GNUNET_TESTBED_ET_OPERATION_FINISHED:
- /* Control reaches here when peer start fails */
- case GNUNET_TESTBED_ET_PEER_START:
- /* we handle peer starts in peer_churn_cb */
- break;
- default:
- GNUNET_assert (0);
- }
- break;
- case STATE_PEERS_LINKING:
- switch (event->type)