aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/mesh_tunnel_tree.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2011-10-18 09:00:06 +0000
committerBart Polot <bart@net.in.tum.de>2011-10-18 09:00:06 +0000
commit97f036d35b9cc9ea11664d81bf05b783365cf20b (patch)
tree74d6fdac03436162af48ff2bdc7c0a0b8af29b6d /src/mesh/mesh_tunnel_tree.c
parentde2b0525d627363de4c624a8b8ddc47e3bbd2f87 (diff)
downloadgnunet-97f036d35b9cc9ea11664d81bf05b783365cf20b.tar.gz
gnunet-97f036d35b9cc9ea11664d81bf05b783365cf20b.zip
Made multicast work for single peer tunnels
Diffstat (limited to 'src/mesh/mesh_tunnel_tree.c')
-rw-r--r--src/mesh/mesh_tunnel_tree.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mesh/mesh_tunnel_tree.c b/src/mesh/mesh_tunnel_tree.c
index b2c03247e..090681517 100644
--- a/src/mesh/mesh_tunnel_tree.c
+++ b/src/mesh/mesh_tunnel_tree.c
@@ -102,10 +102,13 @@ struct GNUNET_PeerIdentity *
102path_get_first_hop (struct MeshTunnelTree *t, GNUNET_PEER_Id peer) 102path_get_first_hop (struct MeshTunnelTree *t, GNUNET_PEER_Id peer)
103{ 103{
104 struct GNUNET_PeerIdentity id; 104 struct GNUNET_PeerIdentity id;
105 struct GNUNET_PeerIdentity *r;
105 106
106 GNUNET_PEER_resolve (peer, &id); 107 GNUNET_PEER_resolve (peer, &id);
107 return GNUNET_CONTAINER_multihashmap_get (t->first_hops, 108 r = GNUNET_CONTAINER_multihashmap_get (t->first_hops, &id.hashPubKey);
108 &id.hashPubKey); 109 GNUNET_break (NULL != r);
110
111 return r;
109} 112}
110 113
111 114
@@ -583,7 +586,8 @@ tree_add_path (struct MeshTunnelTree *t,
583 586
584 if (i == p->length - 1 && NULL != oldnode) 587 if (i == p->length - 1 && NULL != oldnode)
585 { 588 {
586 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "tree: Putting old node into place.\n"); 589 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
590 "tree: Putting old node into place.\n");
587 oldnode->parent = parent; 591 oldnode->parent = parent;
588 GNUNET_CONTAINER_DLL_insert(parent->children_head, 592 GNUNET_CONTAINER_DLL_insert(parent->children_head,
589 parent->children_tail, 593 parent->children_tail,
@@ -606,6 +610,9 @@ tree_add_path (struct MeshTunnelTree *t,
606 /* Add info about first hop into hashmap. */ 610 /* Add info about first hop into hashmap. */
607 if (-1 != me && me < p->length - 1) 611 if (-1 != me && me < p->length - 1)
608 { 612 {
613 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
614 "MESH: finding first hop (own pos %d/%u)\n",
615 me, p->length - 1);
609 GNUNET_PEER_resolve (p->peers[me + 1], &id); 616 GNUNET_PEER_resolve (p->peers[me + 1], &id);
610 tree_update_first_hops(t, 617 tree_update_first_hops(t,
611 tree_find_peer(t->root, p->peers[p->length - 1]), 618 tree_find_peer(t->root, p->peers[p->length - 1]),