diff options
author | Supriti Singh <supritisingh08@gmail.com> | 2014-08-10 23:29:04 +0000 |
---|---|---|
committer | Supriti Singh <supritisingh08@gmail.com> | 2014-08-10 23:29:04 +0000 |
commit | ab550f5d9523c43a7384e97dc5ee1d645885c397 (patch) | |
tree | 0b8e13386ec7980fa9c50940bb8bb1e49926a937 /src | |
parent | c4120e884178ef03790baeab572570c9bb52c7c9 (diff) | |
download | gnunet-ab550f5d9523c43a7384e97dc5ee1d645885c397.tar.gz gnunet-ab550f5d9523c43a7384e97dc5ee1d645885c397.zip |
xvine:fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/dht/gnunet-service-xdht_neighbours.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c index b022baad7..a06dfd87b 100644 --- a/src/dht/gnunet-service-xdht_neighbours.c +++ b/src/dht/gnunet-service-xdht_neighbours.c | |||
@@ -4010,9 +4010,7 @@ handle_dht_p2p_trail_setup (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
4010 | { | 4010 | { |
4011 | if(0 == GNUNET_CRYPTO_cmp_peer_identity(&trail_peer_list[i],&my_identity)) | 4011 | if(0 == GNUNET_CRYPTO_cmp_peer_identity(&trail_peer_list[i],&my_identity)) |
4012 | { | 4012 | { |
4013 | //Here if you already were present in the trail. then you | 4013 | trail_length = i; |
4014 | // should trail length to i + 1 | ||
4015 | trail_length = i+1; | ||
4016 | break; | 4014 | break; |
4017 | } | 4015 | } |
4018 | } | 4016 | } |
@@ -4059,7 +4057,7 @@ handle_dht_p2p_trail_setup (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
4059 | } | 4057 | } |
4060 | 4058 | ||
4061 | if (trail_length > 0) | 4059 | if (trail_length > 0) |
4062 | target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, peer); | 4060 | target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, &trail_peer_list[trail_length-1]); |
4063 | else | 4061 | else |
4064 | target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, &source); | 4062 | target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, &source); |
4065 | if (NULL == target_friend) | 4063 | if (NULL == target_friend) |
@@ -4084,16 +4082,6 @@ handle_dht_p2p_trail_setup (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
4084 | 4082 | ||
4085 | if (0 != GNUNET_CRYPTO_cmp_peer_identity(&my_identity, &source)) | 4083 | if (0 != GNUNET_CRYPTO_cmp_peer_identity(&my_identity, &source)) |
4086 | { | 4084 | { |
4087 | if(0 == GNUNET_CRYPTO_cmp_peer_identity(&my_identity, &trail_peer_list[trail_length -1 ])) | ||
4088 | { | ||
4089 | GDS_NEIGHBOURS_send_trail_setup (source, | ||
4090 | final_dest_finger_val, | ||
4091 | next_peer.best_known_destination, | ||
4092 | target_friend, trail_length, trail_peer_list, | ||
4093 | is_predecessor, trail_id, | ||
4094 | next_peer.trail_id); | ||
4095 | } | ||
4096 | else{ | ||
4097 | /* Add yourself to list of peers. */ | 4085 | /* Add yourself to list of peers. */ |
4098 | struct GNUNET_PeerIdentity peer_list[trail_length + 1]; | 4086 | struct GNUNET_PeerIdentity peer_list[trail_length + 1]; |
4099 | 4087 | ||
@@ -4107,7 +4095,6 @@ handle_dht_p2p_trail_setup (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
4107 | target_friend, trail_length + 1, peer_list, | 4095 | target_friend, trail_length + 1, peer_list, |
4108 | is_predecessor, trail_id, | 4096 | is_predecessor, trail_id, |
4109 | next_peer.trail_id); | 4097 | next_peer.trail_id); |
4110 | } | ||
4111 | } | 4098 | } |
4112 | else | 4099 | else |
4113 | GDS_NEIGHBOURS_send_trail_setup (source, | 4100 | GDS_NEIGHBOURS_send_trail_setup (source, |
@@ -4764,8 +4751,11 @@ handle_dht_p2p_verify_successor(void *cls, | |||
4764 | next_hop = GDS_ROUTING_get_next_hop (trail_id, GDS_ROUTING_SRC_TO_DEST); | 4751 | next_hop = GDS_ROUTING_get_next_hop (trail_id, GDS_ROUTING_SRC_TO_DEST); |
4765 | if (NULL == next_hop) | 4752 | if (NULL == next_hop) |
4766 | { | 4753 | { |
4767 | GNUNET_break_op (0); | 4754 | // GNUNET_break_op (0); |
4768 | return GNUNET_SYSERR; | 4755 | // return GNUNET_SYSERR; |
4756 | //FIXME: Here it may happen that trail has not yet been added | ||
4757 | //in notify successor. | ||
4758 | return GNUNET_OK; | ||
4769 | } | 4759 | } |
4770 | 4760 | ||
4771 | target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, next_hop); | 4761 | target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, next_hop); |