diff options
author | LRN <lrn1986@gmail.com> | 2013-12-19 06:00:23 +0000 |
---|---|---|
committer | LRN <lrn1986@gmail.com> | 2013-12-19 06:00:23 +0000 |
commit | e0ca7357cd0bfedc5c29cb731b56279fef8da059 (patch) | |
tree | ecfd47cf59bc00e656b53fd59c58f5038e342d65 /src/testbed/gnunet-service-testbed_links.c | |
parent | 92fd84dc7ef98452f848a62677c61a2b80b5835e (diff) | |
download | gnunet-e0ca7357cd0bfedc5c29cb731b56279fef8da059.tar.gz gnunet-e0ca7357cd0bfedc5c29cb731b56279fef8da059.zip |
malloc -> new
Diffstat (limited to 'src/testbed/gnunet-service-testbed_links.c')
-rw-r--r-- | src/testbed/gnunet-service-testbed_links.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/testbed/gnunet-service-testbed_links.c b/src/testbed/gnunet-service-testbed_links.c index 766c47471..cb908f12b 100644 --- a/src/testbed/gnunet-service-testbed_links.c +++ b/src/testbed/gnunet-service-testbed_links.c | |||
@@ -970,7 +970,7 @@ GST_neighbour_get_connection (struct Neighbour *n, | |||
970 | GNUNET_assert (NULL != cb); | 970 | GNUNET_assert (NULL != cb); |
971 | LOG_DEBUG ("Attempting to get connection to controller on host %u\n", | 971 | LOG_DEBUG ("Attempting to get connection to controller on host %u\n", |
972 | n->host_id); | 972 | n->host_id); |
973 | h = GNUNET_malloc (sizeof (struct NeighbourConnectNotification)); | 973 | h = GNUNET_new (struct NeighbourConnectNotification); |
974 | h->n = n; | 974 | h->n = n; |
975 | h->cb = cb; | 975 | h->cb = cb; |
976 | h->cb_cls = cb_cls; | 976 | h->cb_cls = cb_cls; |
@@ -1163,7 +1163,7 @@ GST_create_neighbour (struct GNUNET_TESTBED_Host *host) | |||
1163 | { | 1163 | { |
1164 | struct Neighbour *n; | 1164 | struct Neighbour *n; |
1165 | 1165 | ||
1166 | n = GNUNET_malloc (sizeof (struct Neighbour)); | 1166 | n = GNUNET_new (struct Neighbour); |
1167 | n->host_id = GNUNET_TESTBED_host_get_id_ (host); | 1167 | n->host_id = GNUNET_TESTBED_host_get_id_ (host); |
1168 | neighbour_list_add (n); /* just add; connect on-demand */ | 1168 | neighbour_list_add (n); /* just add; connect on-demand */ |
1169 | return n; | 1169 | return n; |
@@ -1249,7 +1249,7 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1249 | LOG_DEBUG ("Received request to establish a link to host %u\n", | 1249 | LOG_DEBUG ("Received request to establish a link to host %u\n", |
1250 | delegated_host_id); | 1250 | delegated_host_id); |
1251 | n = GST_create_neighbour (GST_host_list[delegated_host_id]); | 1251 | n = GST_create_neighbour (GST_host_list[delegated_host_id]); |
1252 | ncc = GNUNET_malloc (sizeof (struct NeighbourConnectCtxt)); | 1252 | ncc = GNUNET_new (struct NeighbourConnectCtxt); |
1253 | ncc->n = n; | 1253 | ncc->n = n; |
1254 | ncc->op_id = op_id; | 1254 | ncc->op_id = op_id; |
1255 | ncc->client = client; | 1255 | ncc->client = client; |
@@ -1271,11 +1271,11 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1271 | } | 1271 | } |
1272 | LOG_DEBUG ("Received request to start and establish a link to host %u\n", | 1272 | LOG_DEBUG ("Received request to start and establish a link to host %u\n", |
1273 | delegated_host_id); | 1273 | delegated_host_id); |
1274 | slave = GNUNET_malloc (sizeof (struct Slave)); | 1274 | slave = GNUNET_new (struct Slave); |
1275 | slave->host_id = delegated_host_id; | 1275 | slave->host_id = delegated_host_id; |
1276 | slave->reghost_map = GNUNET_CONTAINER_multihashmap_create (100, GNUNET_NO); | 1276 | slave->reghost_map = GNUNET_CONTAINER_multihashmap_create (100, GNUNET_NO); |
1277 | slave_list_add (slave); | 1277 | slave_list_add (slave); |
1278 | lcc = GNUNET_malloc (sizeof (struct LinkControllersContext)); | 1278 | lcc = GNUNET_new (struct LinkControllersContext); |
1279 | lcc->operation_id = op_id; | 1279 | lcc->operation_id = op_id; |
1280 | GNUNET_SERVER_client_keep (client); | 1280 | GNUNET_SERVER_client_keep (client); |
1281 | lcc->client = client; | 1281 | lcc->client = client; |
@@ -1284,7 +1284,7 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1284 | GNUNET_TESTBED_controller_start (GST_context->master_ip, | 1284 | GNUNET_TESTBED_controller_start (GST_context->master_ip, |
1285 | GST_host_list[slave->host_id], | 1285 | GST_host_list[slave->host_id], |
1286 | &slave_status_cb, slave); | 1286 | &slave_status_cb, slave); |
1287 | new_route = GNUNET_malloc (sizeof (struct Route)); | 1287 | new_route = GNUNET_new (struct Route); |
1288 | new_route->dest = delegated_host_id; | 1288 | new_route->dest = delegated_host_id; |
1289 | new_route->thru = GST_context->host_id; | 1289 | new_route->thru = GST_context->host_id; |
1290 | route_list_add (new_route); | 1290 | route_list_add (new_route); |
@@ -1298,8 +1298,8 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1298 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 1298 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
1299 | return; | 1299 | return; |
1300 | } | 1300 | } |
1301 | lcfq = GNUNET_malloc (sizeof (struct LCFContextQueue)); | 1301 | lcfq = GNUNET_new (struct LCFContextQueue); |
1302 | lcfq->lcf = GNUNET_malloc (sizeof (struct LCFContext)); | 1302 | lcfq->lcf = GNUNET_new (struct LCFContext); |
1303 | lcfq->lcf->delegated_host_id = delegated_host_id; | 1303 | lcfq->lcf->delegated_host_id = delegated_host_id; |
1304 | lcfq->lcf->slave_host_id = slave_host_id; | 1304 | lcfq->lcf->slave_host_id = slave_host_id; |
1305 | route = GST_find_dest_route (slave_host_id); | 1305 | route = GST_find_dest_route (slave_host_id); |
@@ -1335,7 +1335,7 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1335 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 1335 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
1336 | return; | 1336 | return; |
1337 | } | 1337 | } |
1338 | new_route = GNUNET_malloc (sizeof (struct Route)); | 1338 | new_route = GNUNET_new (struct Route); |
1339 | new_route->dest = delegated_host_id; | 1339 | new_route->dest = delegated_host_id; |
1340 | new_route->thru = route->dest; | 1340 | new_route->thru = route->dest; |
1341 | route_list_add (new_route); | 1341 | route_list_add (new_route); |