gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r31262 - gnunet/src/dv


From: gnunet
Subject: [GNUnet-SVN] r31262 - gnunet/src/dv
Date: Tue, 10 Dec 2013 15:33:44 +0100

Author: grothoff
Date: 2013-12-10 15:33:44 +0100 (Tue, 10 Dec 2013)
New Revision: 31262

Modified:
   gnunet/src/dv/gnunet-service-dv.c
   gnunet/src/dv/test_transport_dv_data.conf
Log:
-trying to fix #3189

Modified: gnunet/src/dv/gnunet-service-dv.c
===================================================================
--- gnunet/src/dv/gnunet-service-dv.c   2013-12-10 14:26:37 UTC (rev 31261)
+++ gnunet/src/dv/gnunet-service-dv.c   2013-12-10 14:33:44 UTC (rev 31262)
@@ -803,9 +803,15 @@
   struct DirectNeighbor *neighbor = cls;
   struct GNUNET_SET_Element element;
   struct Target *target;
+  struct Route *route;
 
   target = NULL;
+  /* skip over NULL entries */
   while ( (DEFAULT_FISHEYE_DEPTH > neighbor->consensus_insertion_distance) &&
+         (consensi[neighbor->consensus_insertion_distance].array_length > 
neighbor->consensus_insertion_offset) &&
+         (NULL == 
consensi[neighbor->consensus_insertion_distance].targets[neighbor->consensus_insertion_offset])
 )
+    neighbor->consensus_insertion_offset++;
+  while ( (DEFAULT_FISHEYE_DEPTH > neighbor->consensus_insertion_distance) &&
          (consensi[neighbor->consensus_insertion_distance].array_length == 
neighbor->consensus_insertion_offset) )
   {
     /* If we reached the last element of a consensus array element: increase 
distance and start with next array */
@@ -831,24 +837,18 @@
     return;
   }
 
-  target = 
&consensi[neighbor->consensus_insertion_distance].targets[neighbor->consensus_insertion_offset]->target;
+  route = 
consensi[neighbor->consensus_insertion_distance].targets[neighbor->consensus_insertion_offset];
+  GNUNET_assert (NULL != route);
+  target = &route->target;
   element.size = sizeof (struct Target);
   element.type = htons (0); /* do we need this? */
   element.data = target;
 
   /* Find next non-NULL entry */
   neighbor->consensus_insertion_offset++;
-  /* skip over NULL entries */
-  while ( (DEFAULT_FISHEYE_DEPTH > neighbor->consensus_insertion_distance) &&
-         (consensi[neighbor->consensus_insertion_distance].array_length > 
neighbor->consensus_insertion_offset) &&
-         (NULL == 
consensi[neighbor->consensus_insertion_distance].targets[neighbor->consensus_insertion_offset])
 )
+  if ( (0 != memcmp (&target->peer, &my_identity, sizeof (my_identity))) &&
+       (0 != memcmp (&target->peer, &neighbor->peer, sizeof (neighbor->peer))) 
)
   {
-    neighbor->consensus_insertion_offset++;
-  }
-
-  if ( (0 != memcmp(&target->peer, &my_identity, sizeof (my_identity))) &&
-       (0 != memcmp(&target->peer, &neighbor->peer, sizeof (neighbor->peer))) )
-  {
     /* Add target if it is not the neighbor or this peer */
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Adding peer `%s' with distance %u to SET\n",
@@ -860,7 +860,7 @@
     neighbor->consensus_elements++;
   }
   else
-    build_set(neighbor);
+    build_set (neighbor);
 }
 
 

Modified: gnunet/src/dv/test_transport_dv_data.conf
===================================================================
--- gnunet/src/dv/test_transport_dv_data.conf   2013-12-10 14:26:37 UTC (rev 
31261)
+++ gnunet/src/dv/test_transport_dv_data.conf   2013-12-10 14:33:44 UTC (rev 
31262)
@@ -11,4 +11,4 @@
 
 [set]
 AUTOSTART = YES
-#PREFIX = valgrind
\ No newline at end of file
+PREFIX = valgrind




reply via email to

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