WiP
authorBart Polot <bart@net.in.tum.de>
Tue, 11 Oct 2011 10:52:56 +0000 (10:52 +0000)
committerBart Polot <bart@net.in.tum.de>
Tue, 11 Oct 2011 10:52:56 +0000 (10:52 +0000)
src/mesh/gnunet-service-mesh.c
src/mesh/mesh_tunnel_tree.c

index 53feb309d21224c3112e826e8d5fb1ff8c218e6a..1f29e6c7831165047e4cafffe1a48c774b97301c 100644 (file)
@@ -776,7 +776,7 @@ peer_info_cancel_transmission(struct MeshPeerInfo *peer, unsigned int i)
  * 
  */
 static unsigned int
-peer_info_transmit_position (struct MeshPeerInfo *peer)
+peer_info_transmit_slot (struct MeshPeerInfo *peer)
 {
   unsigned int i;
 
@@ -858,7 +858,14 @@ send_create_path (struct MeshPeerInfo *peer,
   unsigned int i;
 
   if (NULL == p)
+  {
     p = tree_get_path_to_peer(t->tree, peer->id);
+    if (NULL == p)
+    {
+      GNUNET_break (0);
+      return;
+    }
+  }
   for (i = 0; i < p->length; i++)
   {
     if (p->peers[i] == myid)
@@ -876,7 +883,7 @@ send_create_path (struct MeshPeerInfo *peer,
   path_info->peer = peer;
   path_info->t = t;
   neighbor = peer_info_get(&id);
-  path_info->pos = peer_info_transmit_position(neighbor);
+  path_info->pos = peer_info_transmit_slot(neighbor);
   neighbor->types[path_info->pos] = GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE;
   neighbor->infos[path_info->pos] = path_info;
   neighbor->core_transmit[path_info->pos] = 
@@ -890,7 +897,6 @@ send_create_path (struct MeshPeerInfo *peer,
           + (p->length * sizeof (struct GNUNET_PeerIdentity)), /*size */
           &send_core_create_path, /* callback */
           path_info);        /* cls */
-  
 }
 
 
@@ -1402,6 +1408,18 @@ tunnel_add_peer (struct MeshTunnel *t, struct MeshPeerInfo *peer)
   }
 }
 
+/**
+ * Add a path to a tunnel, without evaluating costs.
+ *
+ * @param t Tunnel we want to add a new peer to
+ * @param p Path to add
+ *
+ */
+static void
+tunnel_add_path (struct MeshTunnel *t, struct MeshPeerPath *p)
+{
+}
+
 
 /**
  * Notify a tunnel that a connection has broken that affects at least
@@ -1967,7 +1985,7 @@ handle_mesh_path_create (void *cls, const struct GNUNET_PeerIdentity *peer,
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "MESH:   Retransmitting.\n");
     path_add_to_peer(dest_peer_info, path);
-    tunnel_add_peer(t, dest_peer_info);
+    tunnel_add_path (t, path);
     path = path_duplicate(path2);
     path_add_to_origin(orig_peer_info, path2);
     send_create_path(dest_peer_info, path, t);
index 56f592de5ceaebdec653e80d4b31b039acb1079a..cea02867011dc19461ee08260107f1f18dab0d3b 100644 (file)
@@ -526,7 +526,6 @@ tree_add_path (struct MeshTunnelTree *t,
              p->length,
              p->peers[p->length - 1],
              t->me->peer);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: %p %p %p\n", t, t->root, t->me);
 
   myid = t->me->peer;
   GNUNET_assert(0 != p->length);