diff options
Diffstat (limited to 'src/mesh/gnunet-service-mesh.c')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 09eb8df1a..7665909e6 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -1278,7 +1278,7 @@ send_destroy_path (struct MeshTunnel *t, GNUNET_PEER_Id destination) | |||
1278 | { | 1278 | { |
1279 | GNUNET_PEER_resolve (p->peers[i], &pi[i]); | 1279 | GNUNET_PEER_resolve (p->peers[i], &pi[i]); |
1280 | } | 1280 | } |
1281 | send_message (&msg->header, path_get_first_hop (t->tree, destination)); | 1281 | send_message (&msg->header, tree_get_first_hop (t->tree, destination)); |
1282 | } | 1282 | } |
1283 | path_destroy (p); | 1283 | path_destroy (p); |
1284 | } | 1284 | } |
@@ -1888,12 +1888,10 @@ tunnel_add_path (struct MeshTunnel *t, struct MeshPeerPath *p, | |||
1888 | 1888 | ||
1889 | GNUNET_assert (0 != own_pos); | 1889 | GNUNET_assert (0 != own_pos); |
1890 | tree_add_path (t->tree, p, NULL, NULL); | 1890 | tree_add_path (t->tree, p, NULL, NULL); |
1891 | if (tree_get_me (t->tree) == 0) | ||
1892 | tree_set_me (t->tree, p->peers[own_pos]); | ||
1893 | if (own_pos < p->length - 1) | 1891 | if (own_pos < p->length - 1) |
1894 | { | 1892 | { |
1895 | GNUNET_PEER_resolve (p->peers[own_pos + 1], &id); | 1893 | GNUNET_PEER_resolve (p->peers[own_pos + 1], &id); |
1896 | tree_update_first_hops (t->tree, tree_get_me (t->tree), &id); | 1894 | tree_update_first_hops (t->tree, myid, &id); |
1897 | } | 1895 | } |
1898 | } | 1896 | } |
1899 | 1897 | ||
@@ -2019,7 +2017,6 @@ tunnel_send_multicast (struct MeshTunnel *t, | |||
2019 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2017 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2020 | "MESH: sending a multicast packet...\n"); | 2018 | "MESH: sending a multicast packet...\n"); |
2021 | #endif | 2019 | #endif |
2022 | GNUNET_assert (tree_get_me (t->tree) != 0); | ||
2023 | mdata = GNUNET_malloc (sizeof (struct MeshMulticastData)); | 2020 | mdata = GNUNET_malloc (sizeof (struct MeshMulticastData)); |
2024 | mdata->data_len = ntohs (msg->size); | 2021 | mdata->data_len = ntohs (msg->size); |
2025 | mdata->reference_counter = GNUNET_malloc (sizeof (unsigned int)); | 2022 | mdata->reference_counter = GNUNET_malloc (sizeof (unsigned int)); |
@@ -2280,7 +2277,7 @@ send_core_create_path (void *cls, size_t size, void *buf) | |||
2280 | info->peer->core_transmit[info->pos] = | 2277 | info->peer->core_transmit[info->pos] = |
2281 | GNUNET_CORE_notify_transmit_ready (core_handle, 0, 0, | 2278 | GNUNET_CORE_notify_transmit_ready (core_handle, 0, 0, |
2282 | GNUNET_TIME_UNIT_FOREVER_REL, | 2279 | GNUNET_TIME_UNIT_FOREVER_REL, |
2283 | path_get_first_hop (t->tree, | 2280 | tree_get_first_hop (t->tree, |
2284 | peer->id), | 2281 | peer->id), |
2285 | size_needed, &send_core_create_path, | 2282 | size_needed, &send_core_create_path, |
2286 | info); | 2283 | info); |
@@ -2851,7 +2848,7 @@ handle_mesh_data_unicast (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
2851 | } | 2848 | } |
2852 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2849 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2853 | "MESH: not for us, retransmitting...\n"); | 2850 | "MESH: not for us, retransmitting...\n"); |
2854 | send_message (message, path_get_first_hop (t->tree, pid)); | 2851 | send_message (message, tree_get_first_hop (t->tree, pid)); |
2855 | return GNUNET_OK; | 2852 | return GNUNET_OK; |
2856 | } | 2853 | } |
2857 | 2854 | ||
@@ -3565,7 +3562,6 @@ handle_local_tunnel_create (void *cls, struct GNUNET_SERVER_Client *client, | |||
3565 | return; | 3562 | return; |
3566 | } | 3563 | } |
3567 | t->tree = tree_new (myid); | 3564 | t->tree = tree_new (myid); |
3568 | tree_set_me (t->tree, myid); | ||
3569 | 3565 | ||
3570 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 3566 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
3571 | return; | 3567 | return; |