aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/gnunet-service-testbed.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testbed/gnunet-service-testbed.c')
-rw-r--r--src/testbed/gnunet-service-testbed.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c
index fa4f22375..faa1570a8 100644
--- a/src/testbed/gnunet-service-testbed.c
+++ b/src/testbed/gnunet-service-testbed.c
@@ -428,25 +428,19 @@ struct OverlayConnectContext
428 428
429 429
430/** 430/**
431 * Context data to be used when forwarding peer create messages 431 * Context information for operations forward to subcontrollers
432 */ 432 */
433struct PeerCreateContext 433struct ForwardedOperationContext
434{ 434{
435 /** 435 /**
436 * The operation handle to peer create 436 * Task ID for the timeout task
437 */ 437 */
438 struct GNUNET_TESTBED_operation *operation; 438 GNUNET_SCHEDULER_TaskIdentifier timeout_task;
439 439
440 /** 440 /**
441 * The ID of the operation which created this context 441 * The ID of the operation that is forwarded
442 */ 442 */
443 uint64_t operation_id; 443 uint64_t operation_id;
444
445 /**
446 * The peer create timeout task id
447 */
448 GNUNET_SCHEDULER_TaskIdentifier timeout_task;
449
450}; 444};
451 445
452 446
@@ -1396,10 +1390,12 @@ handle_peer_create (void *cls,
1396 const struct GNUNET_MessageHeader *message) 1390 const struct GNUNET_MessageHeader *message)
1397{ 1391{
1398 const struct GNUNET_TESTBED_PeerCreateMessage *msg; 1392 const struct GNUNET_TESTBED_PeerCreateMessage *msg;
1393 struct GNUNET_TESTBED_PeerCreateMessage *dup_msg;
1399 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage *reply; 1394 struct GNUNET_TESTBED_PeerCreateSuccessEventMessage *reply;
1400 struct GNUNET_CONFIGURATION_Handle *cfg; 1395 struct GNUNET_CONFIGURATION_Handle *cfg;
1401 struct PeerCreateContext *pc_ctxt; 1396 struct ForwardedOperationContext *fo_ctxt;
1402 struct Route *route; 1397 struct Route *route;
1398 struct Peer *peer;
1403 char *config; 1399 char *config;
1404 size_t dest_size; 1400 size_t dest_size;
1405 int ret; 1401 int ret;
@@ -1419,7 +1415,6 @@ handle_peer_create (void *cls,
1419 host_id = ntohl (msg->host_id); 1415 host_id = ntohl (msg->host_id);
1420 if (host_id == master_context->host_id) 1416 if (host_id == master_context->host_id)
1421 { 1417 {
1422 struct Peer *peer;
1423 char *emsg; 1418 char *emsg;
1424 1419
1425 /* We are responsible for this peer */ 1420 /* We are responsible for this peer */
@@ -1489,9 +1484,13 @@ handle_peer_create (void *cls,
1489 GNUNET_SERVER_receive_done (client, GNUNET_OK); 1484 GNUNET_SERVER_receive_done (client, GNUNET_OK);
1490 return; 1485 return;
1491 } 1486 }
1492 pc_ctxt = GNUNET_malloc (sizeof (struct PeerCreateContext)); 1487 fo_ctxt = GNUNET_malloc (sizeof (struct ForwardedOperationContext));
1493 pc_ctxt->operation_id = GNUNET_ntohll (msg->operation_id); 1488 fo_ctxt->operation_id = GNUNET_ntohll (msg->operation_id);
1494 /* To be continued .. :) */ 1489 dup_msg = GNUNET_malloc (msize);
1490 (void) memcpy (dup_msg, msg, msize);
1491 GNUNET_TESTBED_queue_message_ (slave_list[route->dest]->controller,
1492 &dup_msg->header);
1493 GNUNET_SERVER_receive_done (client, GNUNET_OK);
1495} 1494}
1496 1495
1497 1496