diff options
author | Supriti Singh <supritisingh08@gmail.com> | 2014-08-22 11:20:31 +0000 |
---|---|---|
committer | Supriti Singh <supritisingh08@gmail.com> | 2014-08-22 11:20:31 +0000 |
commit | 1c566a6cf35df66afb22b9516e408b2fdc2ff85d (patch) | |
tree | ff4f2492b6cc8cf8c862ebf8b2f4f40ebaf68ec6 | |
parent | cf537e4faf48ae5c99d5dccb27fa628dd1df02c6 (diff) | |
download | gnunet-1c566a6cf35df66afb22b9516e408b2fdc2ff85d.tar.gz gnunet-1c566a6cf35df66afb22b9516e408b2fdc2ff85d.zip |
Handling missing next hop in verify successor
-rw-r--r-- | src/dht/gnunet-service-xdht_neighbours.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c index 08ed33ce7..f0a1cb8b9 100644 --- a/src/dht/gnunet-service-xdht_neighbours.c +++ b/src/dht/gnunet-service-xdht_neighbours.c | |||
@@ -4684,10 +4684,29 @@ handle_dht_p2p_verify_successor(void *cls, | |||
4684 | next_hop = GDS_ROUTING_get_next_hop (trail_id, GDS_ROUTING_SRC_TO_DEST); | 4684 | next_hop = GDS_ROUTING_get_next_hop (trail_id, GDS_ROUTING_SRC_TO_DEST); |
4685 | if (NULL == next_hop) | 4685 | if (NULL == next_hop) |
4686 | { | 4686 | { |
4687 | DEBUG(" NO ENTRY FOUND IN %s ROUTING TABLE for trail id %s, line", | 4687 | //SUPUs anyways you are passing the trail, just do the lookup |
4688 | GNUNET_i2s(&my_identity), GNUNET_h2s(&trail_id), __LINE__); | 4688 | // and pass the message forward. |
4689 | GNUNET_break_op (0); | 4689 | int my_index = search_my_index (trail, trail_length); |
4690 | return GNUNET_OK; | 4690 | if(-1 == my_index) |
4691 | { | ||
4692 | DEBUG(" Peer %s not present in trail id %s, line =%d", | ||
4693 | GNUNET_i2s(&my_identity), GNUNET_h2s(&trail_id), __LINE__); | ||
4694 | GNUNET_break_op (0); | ||
4695 | return GNUNET_OK; | ||
4696 | } | ||
4697 | if((my_index == trail_length + 1)) | ||
4698 | { | ||
4699 | DEBUG(" Peer %s present twice in trail id %s, line =%d", | ||
4700 | GNUNET_i2s(&my_identity), GNUNET_h2s(&trail_id), __LINE__); | ||
4701 | GNUNET_break_op (0); | ||
4702 | return GNUNET_OK; | ||
4703 | } | ||
4704 | if(my_index == (trail_length - 1)) | ||
4705 | { | ||
4706 | *next_hop = successor; | ||
4707 | } | ||
4708 | else | ||
4709 | *next_hop = trail[my_index + 1]; | ||
4691 | } | 4710 | } |
4692 | 4711 | ||
4693 | target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, next_hop); | 4712 | target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, next_hop); |