aboutsummaryrefslogtreecommitdiff
path: root/src/testbed
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-09-14 12:14:00 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-09-14 12:14:00 +0000
commit51473f9f0b03b6133177813cbff54eecb633cea2 (patch)
treeb894f7eba174f2933100476e290f5e6b93255568 /src/testbed
parent69eb1386d533c2ae921033e78647e7e76ae57990 (diff)
downloadgnunet-51473f9f0b03b6133177813cbff54eecb633cea2.tar.gz
gnunet-51473f9f0b03b6133177813cbff54eecb633cea2.zip
add to routing if delegated host is subordinate
Diffstat (limited to 'src/testbed')
-rw-r--r--src/testbed/gnunet-service-testbed.c32
-rw-r--r--src/testbed/misc.supp8
2 files changed, 23 insertions, 17 deletions
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c
index f223913c4..6df2992f0 100644
--- a/src/testbed/gnunet-service-testbed.c
+++ b/src/testbed/gnunet-service-testbed.c
@@ -1368,6 +1368,7 @@ handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client,
1368 if (slave_host_id == master_context->host_id) /* Link from us */ 1368 if (slave_host_id == master_context->host_id) /* Link from us */
1369 { 1369 {
1370 struct Slave *slave; 1370 struct Slave *slave;
1371 struct LinkControllersContext *lcc;
1371 1372
1372 msize -= sizeof (struct GNUNET_TESTBED_ControllerLinkMessage); 1373 msize -= sizeof (struct GNUNET_TESTBED_ControllerLinkMessage);
1373 config_size = ntohs (msg->config_size); 1374 config_size = ntohs (msg->config_size);
@@ -1416,32 +1417,30 @@ handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client,
1416 slave = GNUNET_malloc (sizeof (struct Slave)); 1417 slave = GNUNET_malloc (sizeof (struct Slave));
1417 slave->host_id = delegated_host_id; 1418 slave->host_id = delegated_host_id;
1418 slave_list_add (slave); 1419 slave_list_add (slave);
1419 if (1 == msg->is_subordinate) 1420 if (1 != msg->is_subordinate)
1420 {
1421 struct LinkControllersContext *lcc;
1422
1423 lcc = GNUNET_malloc (sizeof (struct LinkControllersContext));
1424 lcc->operation_id = GNUNET_ntohll (msg->operation_id);
1425 GNUNET_SERVER_client_keep (client);
1426 lcc->client = client;
1427 lcc->slave = slave;
1428 slave->controller_proc =
1429 GNUNET_TESTBED_controller_start (master_context->master_ip,
1430 host_list[slave->host_id], cfg,
1431 &slave_status_callback, lcc);
1432 }
1433 else
1434 { 1421 {
1435 slave->controller = 1422 slave->controller =
1436 GNUNET_TESTBED_controller_connect (cfg, host_list[slave->host_id], 1423 GNUNET_TESTBED_controller_connect (cfg, host_list[slave->host_id],
1437 master_context->event_mask, 1424 master_context->event_mask,
1438 &slave_event_callback, slave); 1425 &slave_event_callback, slave);
1426 GNUNET_CONFIGURATION_destroy (cfg);
1439 if (NULL != slave->controller) 1427 if (NULL != slave->controller)
1440 send_operation_success_msg (client, GNUNET_ntohll (msg->operation_id)); 1428 send_operation_success_msg (client, GNUNET_ntohll (msg->operation_id));
1441 else 1429 else
1442 send_operation_fail_msg (client, GNUNET_ntohll (msg->operation_id), 1430 send_operation_fail_msg (client, GNUNET_ntohll (msg->operation_id),
1443 "Could not connect to delegated controller"); 1431 "Could not connect to delegated controller");
1432 GNUNET_SERVER_receive_done (client, GNUNET_OK);
1433 return;
1444 } 1434 }
1435 lcc = GNUNET_malloc (sizeof (struct LinkControllersContext));
1436 lcc->operation_id = GNUNET_ntohll (msg->operation_id);
1437 GNUNET_SERVER_client_keep (client);
1438 lcc->client = client;
1439 lcc->slave = slave;
1440 slave->controller_proc =
1441 GNUNET_TESTBED_controller_start (master_context->master_ip,
1442 host_list[slave->host_id], cfg,
1443 &slave_status_callback, lcc);
1445 GNUNET_CONFIGURATION_destroy (cfg); 1444 GNUNET_CONFIGURATION_destroy (cfg);
1446 new_route = GNUNET_malloc (sizeof (struct Route)); 1445 new_route = GNUNET_malloc (sizeof (struct Route));
1447 new_route->dest = delegated_host_id; 1446 new_route->dest = delegated_host_id;
@@ -2193,8 +2192,7 @@ handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client,
2193{ 2192{
2194 const struct GNUNET_TESTBED_OverlayConnectMessage *msg; 2193 const struct GNUNET_TESTBED_OverlayConnectMessage *msg;
2195 struct OverlayConnectContext *occ; 2194 struct OverlayConnectContext *occ;
2196 2195 const struct GNUNET_CORE_MessageHandler no_handlers[] = {
2197 struct GNUNET_CORE_MessageHandler no_handlers[] = {
2198 {NULL, 0, 0} 2196 {NULL, 0, 0}
2199 }; 2197 };
2200 uint32_t p1; 2198 uint32_t p1;
diff --git a/src/testbed/misc.supp b/src/testbed/misc.supp
index c8f9ca3e3..95fc69a3b 100644
--- a/src/testbed/misc.supp
+++ b/src/testbed/misc.supp
@@ -32,3 +32,11 @@
32 ... 32 ...
33 obj:/lib/i386-linux-gnu/ld-2.15.so 33 obj:/lib/i386-linux-gnu/ld-2.15.so
34} 34}
35{
36 <glibc-networking>
37 Memcheck:Leak
38 fun:malloc
39 fun:make_request
40 fun:__check_pf
41}
42