gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r27182 - gnunet/src/mesh
Date: Thu, 16 May 2013 18:51:51 +0200

Author: bartpolot
Date: 2013-05-16 18:51:50 +0200 (Thu, 16 May 2013)
New Revision: 27182

Modified:
   gnunet/src/mesh/gnunet-service-mesh-new.c
Log:
- always set prev & next hop to allow reuse of p2p code for local-only tunnels

Modified: gnunet/src/mesh/gnunet-service-mesh-new.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh-new.c   2013-05-16 15:04:15 UTC (rev 
27181)
+++ gnunet/src/mesh/gnunet-service-mesh-new.c   2013-05-16 16:51:50 UTC (rev 
27182)
@@ -1238,12 +1238,6 @@
 {
   struct MeshPeerInfo *peer;
 
-  if (0 == t->prev_hop)
-  {
-    GNUNET_break (0);
-    return;
-  }
-
   peer = peer_get_short (t->prev_hop);
 
   queue_add (t,
@@ -1797,11 +1791,11 @@
   if (i < p->length - 1)
     t->next_hop = p->peers[i + 1];
   else
-    t->next_hop = 0;
+    t->next_hop = p->peers[i];
   if (0 < i)
     t->prev_hop = p->peers[i - 1];
   else
-    t->prev_hop = 0;
+    t->prev_hop = p->peers[0];
 
   if (NULL != t->path)
     path_destroy (t->path);
@@ -1959,10 +1953,10 @@
   }
 
   t->prev_fc.last_ack_sent = ack;
-  if (0 != t->prev_hop)
+  if (NULL != t->owner)
+    send_local_ack (t, t->owner, ack);
+  else if (0 != t->prev_hop)
     send_ack (t, t->prev_hop, ack);
-  else if (NULL != t->owner)
-    send_local_ack (t, t->owner, ack);
   else
     GNUNET_break (0);
   debug_fwd_ack++;
@@ -2025,10 +2019,10 @@
               ack, t->next_fc.last_ack_sent);
   t->next_fc.last_ack_sent = ack;
 
-  if (0 != t->next_hop)
+  if (NULL != t->client)
+    send_local_ack (t, t->client, ack);
+  else if (0 != t->next_hop)
     send_ack (t, t->next_hop, ack);
-  else if (NULL != t->client)
-    send_local_ack (t, t->client, ack);
   else
     GNUNET_break (0);
   t->force_ack = GNUNET_NO;
@@ -2101,7 +2095,7 @@
               "  sending tunnel destroy for tunnel: %s [%X]\n",
               GNUNET_i2s (&msg.oid), t->id.tid);
 
-  if (0 != t->next_hop)
+  if (NULL == t->client)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  child: %u\n", t->next_hop);
     GNUNET_PEER_resolve (t->next_hop, &id);
@@ -2110,7 +2104,7 @@
                 GNUNET_i2s (&id));
     send_prebuilt_message (&msg.header, t->next_hop, t);
   }
-  if (0 != t->prev_hop)
+  if (NULL == t->owner)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  parent: %u\n", t->prev_hop);
     GNUNET_PEER_resolve (t->prev_hop, &id);




reply via email to

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