gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r17365 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r17365 - gnunet/src/mesh
Date: Tue, 11 Oct 2011 12:52:57 +0200

Author: bartpolot
Date: 2011-10-11 12:52:56 +0200 (Tue, 11 Oct 2011)
New Revision: 17365

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
   gnunet/src/mesh/mesh_tunnel_tree.c
Log:
WiP

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2011-10-11 09:58:14 UTC (rev 
17364)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2011-10-11 10:52:56 UTC (rev 
17365)
@@ -776,7 +776,7 @@
  * 
  */
 static unsigned int
-peer_info_transmit_position (struct MeshPeerInfo *peer)
+peer_info_transmit_slot (struct MeshPeerInfo *peer)
 {
   unsigned int i;
 
@@ -858,7 +858,14 @@
   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 @@
   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 @@
           + (p->length * sizeof (struct GNUNET_PeerIdentity)), /*size */
           &send_core_create_path, /* callback */
           path_info);        /* cls */
-  
 }
 
 
@@ -1402,7 +1408,19 @@
   }
 }
 
+/**
+ * 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
  * some of its peers.
@@ -1967,7 +1985,7 @@
     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);

Modified: gnunet/src/mesh/mesh_tunnel_tree.c
===================================================================
--- gnunet/src/mesh/mesh_tunnel_tree.c  2011-10-11 09:58:14 UTC (rev 17364)
+++ gnunet/src/mesh/mesh_tunnel_tree.c  2011-10-11 10:52:56 UTC (rev 17365)
@@ -526,7 +526,6 @@
              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);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]