[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r34138 - gnunet/src/dht
From: |
gnunet |
Subject: |
[GNUnet-SVN] r34138 - gnunet/src/dht |
Date: |
Mon, 11 Aug 2014 00:27:48 +0200 |
Author: supriti
Date: 2014-08-11 00:27:48 +0200 (Mon, 11 Aug 2014)
New Revision: 34138
Modified:
gnunet/src/dht/gnunet-service-xdht_neighbours.c
Log:
xvine:fixes
Modified: gnunet/src/dht/gnunet-service-xdht_neighbours.c
===================================================================
--- gnunet/src/dht/gnunet-service-xdht_neighbours.c 2014-08-10 21:25:18 UTC
(rev 34137)
+++ gnunet/src/dht/gnunet-service-xdht_neighbours.c 2014-08-10 22:27:48 UTC
(rev 34138)
@@ -4006,19 +4006,17 @@
}
/* Check if you are present in the trail seen so far? */
- if(trail_length > 0)
+ for (i = 0; i < trail_length ; i++)
{
- for (i = 0; i < trail_length ; i++)
+ if(0 == GNUNET_CRYPTO_cmp_peer_identity(&trail_peer_list[i],&my_identity))
{
- if(0 ==
GNUNET_CRYPTO_cmp_peer_identity(&trail_peer_list[i],&my_identity))
- {
//Here if you already were present in the trail. then you
- // shoudl trail length to i + 1
- trail_length = i+1;
- break;
- }
+ // should trail length to i + 1
+ trail_length = i+1;
+ break;
}
}
+
/* Is my routing table full? */
if (GNUNET_YES == GDS_ROUTING_threshold_reached())
@@ -4086,6 +4084,16 @@
if (0 != GNUNET_CRYPTO_cmp_peer_identity(&my_identity, &source))
{
+ if(0 == GNUNET_CRYPTO_cmp_peer_identity(&my_identity,
&trail_peer_list[trail_length -1 ]))
+ {
+ GDS_NEIGHBOURS_send_trail_setup (source,
+ final_dest_finger_val,
+ next_peer.best_known_destination,
+ target_friend, trail_length,
trail_peer_list,
+ is_predecessor, trail_id,
+ next_peer.trail_id);
+ }
+ else{
/* Add yourself to list of peers. */
struct GNUNET_PeerIdentity peer_list[trail_length + 1];
@@ -4099,6 +4107,7 @@
target_friend, trail_length + 1,
peer_list,
is_predecessor, trail_id,
next_peer.trail_id);
+ }
}
else
GDS_NEIGHBOURS_send_trail_setup (source,
@@ -4476,11 +4485,6 @@
joined_trail[i] = trail_2[j];
}
- /* THIS CODE IS ONLY FOR TESTNG. FIXME*/
- for(i = 0; i < *joined_trail_len; i++)
- {
- GNUNET_assert(0 != GNUNET_CRYPTO_cmp_peer_identity(&my_identity,
&joined_trail[i]));
- }
return joined_trail;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r34138 - gnunet/src/dht,
gnunet <=