aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2011-10-03 17:01:14 +0000
committerBart Polot <bart@net.in.tum.de>2011-10-03 17:01:14 +0000
commite0ebb234fd577963c74d65b7db470edb2ea6b5ab (patch)
tree4bf75b15bc21d15972154ef39ab80941b20dcd0c /src/mesh
parent8d41ce66589d90b1120ef6a72a7b9869ca6ca29f (diff)
downloadgnunet-e0ebb234fd577963c74d65b7db470edb2ea6b5ab.tar.gz
gnunet-e0ebb234fd577963c74d65b7db470edb2ea6b5ab.zip
Fixed size request from core on create path and path ack, reformatted call to make more readable
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/gnunet-service-mesh.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index c1a35b37f..2c31ad68c 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -1228,7 +1228,8 @@ send_core_create_path (void *cls, size_t size, void *buf)
1228 GNUNET_CORE_notify_transmit_ready (core_handle, 0, 0, 1228 GNUNET_CORE_notify_transmit_ready (core_handle, 0, 0,
1229 GNUNET_TIME_UNIT_FOREVER_REL, 1229 GNUNET_TIME_UNIT_FOREVER_REL,
1230 path_get_first_hop (t->tree, peer->id), 1230 path_get_first_hop (t->tree, peer->id),
1231 size_needed, &send_core_create_path, 1231 size_needed,
1232 &send_core_create_path,
1232 info); 1233 info);
1233 return 0; 1234 return 0;
1234 } 1235 }
@@ -1247,6 +1248,9 @@ send_core_create_path (void *cls, size_t size, void *buf)
1247 path_destroy (p); 1248 path_destroy (p);
1248 GNUNET_free (info); 1249 GNUNET_free (info);
1249 1250
1251 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1252 "MESH: %u bytes long create path sent!\n",
1253 size_needed);
1250 return size_needed; 1254 return size_needed;
1251} 1255}
1252 1256
@@ -1656,7 +1660,7 @@ handle_mesh_path_create (void *cls, const struct GNUNET_PeerIdentity *peer,
1656 info->peer->core_transmit[j] = 1660 info->peer->core_transmit[j] =
1657 GNUNET_CORE_notify_transmit_ready (core_handle, 0, 100, 1661 GNUNET_CORE_notify_transmit_ready (core_handle, 0, 100,
1658 GNUNET_TIME_UNIT_FOREVER_REL, peer, 1662 GNUNET_TIME_UNIT_FOREVER_REL, peer,
1659 sizeof (struct GNUNET_MessageHeader), 1663 sizeof (struct GNUNET_MESH_PathACK),
1660 &send_core_path_ack, info); 1664 &send_core_path_ack, info);
1661 } 1665 }
1662 else 1666 else
@@ -1671,10 +1675,16 @@ handle_mesh_path_create (void *cls, const struct GNUNET_PeerIdentity *peer,
1671 1675
1672 path_add_to_peer (dest_peer_info, path); 1676 path_add_to_peer (dest_peer_info, path);
1673 GNUNET_PEER_resolve (path->peers[own_pos + 1], &id); 1677 GNUNET_PEER_resolve (path->peers[own_pos + 1], &id);
1674 GNUNET_CORE_notify_transmit_ready (core_handle, 0, 0, 1678 GNUNET_CORE_notify_transmit_ready (
1675 GNUNET_TIME_UNIT_FOREVER_REL, &id, 1679 core_handle,
1676 sizeof (struct GNUNET_MessageHeader), 1680 0,
1677 &send_core_create_path, path_info); 1681 0,
1682 GNUNET_TIME_UNIT_FOREVER_REL,
1683 &id,
1684 sizeof (struct GNUNET_MESH_ManipulatePath) +
1685 path->length * sizeof(struct GNUNET_PeerIdentity),
1686 &send_core_create_path,
1687 path_info);
1678 } 1688 }
1679 return GNUNET_OK; 1689 return GNUNET_OK;
1680} 1690}
@@ -2717,12 +2727,16 @@ handle_local_connect_add (void *cls, struct GNUNET_SERVER_Client *client,
2717 peer_info->infos[i] = path_info; 2727 peer_info->infos[i] = path_info;
2718 peer_info->types[i] = GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE; 2728 peer_info->types[i] = GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE;
2719 peer_info->core_transmit[i] = 2729 peer_info->core_transmit[i] =
2720 GNUNET_CORE_notify_transmit_ready (core_handle, 0, 0, 2730 GNUNET_CORE_notify_transmit_ready (
2721 GNUNET_TIME_UNIT_FOREVER_REL, 2731 core_handle,
2722 path_get_first_hop(t->tree, 2732 0,
2723 path_info->peer->id), 2733 0,
2724 sizeof (struct GNUNET_MessageHeader), 2734 GNUNET_TIME_UNIT_FOREVER_REL,
2725 &send_core_create_path, path_info); 2735 path_get_first_hop(t->tree, path_info->peer->id),
2736 sizeof (struct GNUNET_MESH_ManipulatePath)
2737 + path_info->path->length * sizeof(struct GNUNET_PeerIdentity),
2738 &send_core_create_path,
2739 path_info);
2726 } 2740 }
2727 /* Otherwise: there is no path yet, but there is a DHT_get active already. */ 2741 /* Otherwise: there is no path yet, but there is a DHT_get active already. */
2728 GNUNET_SERVER_receive_done (client, GNUNET_OK); 2742 GNUNET_SERVER_receive_done (client, GNUNET_OK);