diff options
Diffstat (limited to 'src/testbed/gnunet-service-testbed.c')
-rw-r--r-- | src/testbed/gnunet-service-testbed.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c index 1bd22958e..05d296fee 100644 --- a/src/testbed/gnunet-service-testbed.c +++ b/src/testbed/gnunet-service-testbed.c | |||
@@ -180,8 +180,7 @@ struct Slave | |||
180 | struct GNUNET_TESTBED_Controller *controller; | 180 | struct GNUNET_TESTBED_Controller *controller; |
181 | 181 | ||
182 | /** | 182 | /** |
183 | * The configuration of the slave. Will be NULL for slave which we didn't | 183 | * The configuration of the slave. Cannot be NULL |
184 | * directly start | ||
185 | */ | 184 | */ |
186 | struct GNUNET_CONFIGURATION_Handle *cfg; | 185 | struct GNUNET_CONFIGURATION_Handle *cfg; |
187 | 186 | ||
@@ -1546,7 +1545,7 @@ handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1546 | GNUNET_TESTBED_controller_connect (cfg, host_list[slave->host_id], | 1545 | GNUNET_TESTBED_controller_connect (cfg, host_list[slave->host_id], |
1547 | master_context->event_mask, | 1546 | master_context->event_mask, |
1548 | &slave_event_callback, slave); | 1547 | &slave_event_callback, slave); |
1549 | GNUNET_CONFIGURATION_destroy (cfg); | 1548 | slave->cfg = cfg; |
1550 | if (NULL != slave->controller) | 1549 | if (NULL != slave->controller) |
1551 | send_operation_success_msg (client, GNUNET_ntohll (msg->operation_id)); | 1550 | send_operation_success_msg (client, GNUNET_ntohll (msg->operation_id)); |
1552 | else | 1551 | else |
@@ -2474,23 +2473,31 @@ handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client, | |||
2474 | if ((peer2_host_id >= slave_list_size) | 2473 | if ((peer2_host_id >= slave_list_size) |
2475 | || (NULL ==slave_list[peer2_host_id])) | 2474 | || (NULL ==slave_list[peer2_host_id])) |
2476 | { | 2475 | { |
2477 | /* Peer2's host is located above us or lateral to us.. | 2476 | struct GNUNET_TESTBED_NeedControllerConfig *reply; |
2478 | FIXME: should try to ask for the configuration of peer2's host by | 2477 | |
2479 | sending a reply asking for its configuration */ | ||
2480 | GNUNET_break (0); | ||
2481 | GNUNET_SERVER_client_drop (client); | ||
2482 | GNUNET_free (occ); | 2478 | GNUNET_free (occ); |
2483 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 2479 | reply = GNUNET_malloc (sizeof (struct |
2480 | GNUNET_TESTBED_NeedControllerConfig)); | ||
2481 | reply->header.size = htons (sizeof (struct | ||
2482 | GNUNET_TESTBED_NeedControllerConfig)); | ||
2483 | reply->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_NEEDCONTROLLERCONFIG); | ||
2484 | reply->controller_host_id = msg->peer2_host_id; | ||
2485 | reply->operation_id = msg->operation_id; | ||
2486 | queue_message (client, &reply->header); | ||
2487 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | ||
2484 | return; | 2488 | return; |
2485 | } | 2489 | } |
2486 | occ->peer2_controller = slave_list[peer2_host_id]->controller; | 2490 | else |
2487 | if (NULL == occ->peer2_controller) | ||
2488 | { | 2491 | { |
2489 | GNUNET_break (0); | 2492 | occ->peer2_controller = slave_list[peer2_host_id]->controller; |
2490 | GNUNET_SERVER_client_drop (client); | 2493 | if (NULL == occ->peer2_controller) |
2491 | GNUNET_free (occ); | 2494 | { |
2492 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 2495 | GNUNET_break (0); /* What's going on? */ |
2493 | return; | 2496 | GNUNET_SERVER_client_drop (client); |
2497 | GNUNET_free (occ); | ||
2498 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | ||
2499 | return; | ||
2500 | } | ||
2494 | } | 2501 | } |
2495 | } | 2502 | } |
2496 | else | 2503 | else |