diff options
-rw-r--r-- | src/dht/gnunet-service-xdht_neighbours.c | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c index f0a1cb8b9..bf2324ad7 100644 --- a/src/dht/gnunet-service-xdht_neighbours.c +++ b/src/dht/gnunet-service-xdht_neighbours.c | |||
@@ -2618,6 +2618,7 @@ select_and_replace_trail (struct FingerInfo *finger, | |||
2618 | /* Send trail teardown message across the replaced trail. */ | 2618 | /* Send trail teardown message across the replaced trail. */ |
2619 | struct Trail *replace_trail = &finger->trail_list[largest_trail_index]; | 2619 | struct Trail *replace_trail = &finger->trail_list[largest_trail_index]; |
2620 | next_hop = GDS_ROUTING_get_next_hop (replace_trail->trail_id, GDS_ROUTING_SRC_TO_DEST); | 2620 | next_hop = GDS_ROUTING_get_next_hop (replace_trail->trail_id, GDS_ROUTING_SRC_TO_DEST); |
2621 | FPRINTF (stderr,_("\nSUPU %s, %s, %d, REMOVE trail id = %s"),__FILE__, __func__,__LINE__,GNUNET_h2s(&replace_trail->trail_id)); | ||
2621 | GNUNET_assert (GNUNET_YES == GDS_ROUTING_remove_trail (replace_trail->trail_id)); | 2622 | GNUNET_assert (GNUNET_YES == GDS_ROUTING_remove_trail (replace_trail->trail_id)); |
2622 | GDS_NEIGHBOURS_send_trail_teardown (replace_trail->trail_id, | 2623 | GDS_NEIGHBOURS_send_trail_teardown (replace_trail->trail_id, |
2623 | GDS_ROUTING_SRC_TO_DEST, | 2624 | GDS_ROUTING_SRC_TO_DEST, |
@@ -2884,6 +2885,7 @@ send_trail_teardown (struct FingerInfo *finger, | |||
2884 | __LINE__,GNUNET_h2s(&trail->trail_id), GNUNET_i2s(&my_identity),trail->trail_length); | 2885 | __LINE__,GNUNET_h2s(&trail->trail_id), GNUNET_i2s(&my_identity),trail->trail_length); |
2885 | return; | 2886 | return; |
2886 | } | 2887 | } |
2888 | FPRINTF (stderr,_("\nSUPU %s, %s, %d, REMOVE trail id = %s"),__FILE__, __func__,__LINE__,GNUNET_h2s(&trail->trail_id)); | ||
2887 | GNUNET_assert (GNUNET_YES == GDS_ROUTING_remove_trail (trail->trail_id)); | 2889 | GNUNET_assert (GNUNET_YES == GDS_ROUTING_remove_trail (trail->trail_id)); |
2888 | friend->trails_count--; | 2890 | friend->trails_count--; |
2889 | GDS_NEIGHBOURS_send_trail_teardown (trail->trail_id, | 2891 | GDS_NEIGHBOURS_send_trail_teardown (trail->trail_id, |
@@ -3571,6 +3573,7 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3571 | 1, GNUNET_NO); | 3573 | 1, GNUNET_NO); |
3572 | 3574 | ||
3573 | GNUNET_break_op (0); | 3575 | GNUNET_break_op (0); |
3576 | //Fixme: even after circle is compelte, it fails | ||
3574 | //FIXME: Adding put here,only to ensure that process does not hang. but | 3577 | //FIXME: Adding put here,only to ensure that process does not hang. but |
3575 | // should not be here. fix the logic. | 3578 | // should not be here. fix the logic. |
3576 | GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (put->expiration_time), | 3579 | GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (put->expiration_time), |
@@ -4686,27 +4689,28 @@ handle_dht_p2p_verify_successor(void *cls, | |||
4686 | { | 4689 | { |
4687 | //SUPUs anyways you are passing the trail, just do the lookup | 4690 | //SUPUs anyways you are passing the trail, just do the lookup |
4688 | // and pass the message forward. | 4691 | // and pass the message forward. |
4689 | int my_index = search_my_index (trail, trail_length); | 4692 | FPRINTF (stderr,_("\nSUPU %s, %s, %d, Trail not found trail id = %s"),__FILE__, __func__,__LINE__,GNUNET_h2s(&trail_id)); |
4690 | if(-1 == my_index) | 4693 | // int my_index = search_my_index (trail, trail_length); |
4691 | { | 4694 | // if(-1 == my_index) |
4692 | DEBUG(" Peer %s not present in trail id %s, line =%d", | 4695 | // { |
4693 | GNUNET_i2s(&my_identity), GNUNET_h2s(&trail_id), __LINE__); | 4696 | // DEBUG(" Peer %s not present in trail id %s, line =%d", |
4694 | GNUNET_break_op (0); | 4697 | // GNUNET_i2s(&my_identity), GNUNET_h2s(&trail_id), __LINE__); |
4695 | return GNUNET_OK; | 4698 | // GNUNET_break_op (0); |
4696 | } | 4699 | // return GNUNET_OK; |
4697 | if((my_index == trail_length + 1)) | 4700 | // } |
4698 | { | 4701 | // if((my_index == trail_length + 1)) |
4699 | DEBUG(" Peer %s present twice in trail id %s, line =%d", | 4702 | // { |
4700 | GNUNET_i2s(&my_identity), GNUNET_h2s(&trail_id), __LINE__); | 4703 | // DEBUG(" Peer %s present twice in trail id %s, line =%d", |
4701 | GNUNET_break_op (0); | 4704 | // GNUNET_i2s(&my_identity), GNUNET_h2s(&trail_id), __LINE__); |
4702 | return GNUNET_OK; | 4705 | // GNUNET_break_op (0); |
4703 | } | 4706 | // return GNUNET_OK; |
4704 | if(my_index == (trail_length - 1)) | 4707 | // } |
4705 | { | 4708 | // if(my_index == (trail_length - 1)) |
4706 | *next_hop = successor; | 4709 | // { |
4707 | } | 4710 | // *next_hop = successor; |
4708 | else | 4711 | // } |
4709 | *next_hop = trail[my_index + 1]; | 4712 | // else |
4713 | // *next_hop = trail[my_index + 1]; | ||
4710 | } | 4714 | } |
4711 | 4715 | ||
4712 | target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, next_hop); | 4716 | target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, next_hop); |
@@ -5349,6 +5353,7 @@ handle_dht_p2p_trail_teardown (void *cls, const struct GNUNET_PeerIdentity *peer | |||
5349 | /* I am the next hop, which means I am the final destination. */ | 5353 | /* I am the next hop, which means I am the final destination. */ |
5350 | if (0 == GNUNET_CRYPTO_cmp_peer_identity (next_hop, &my_identity)) | 5354 | if (0 == GNUNET_CRYPTO_cmp_peer_identity (next_hop, &my_identity)) |
5351 | { | 5355 | { |
5356 | FPRINTF (stderr,_("\nSUPU %s, %s, %d, REMOVE trail id = %s"),__FILE__, __func__,__LINE__,GNUNET_h2s(&trail_id)); | ||
5352 | GNUNET_assert (GNUNET_YES == GDS_ROUTING_remove_trail (trail_id)); | 5357 | GNUNET_assert (GNUNET_YES == GDS_ROUTING_remove_trail (trail_id)); |
5353 | return GNUNET_OK; | 5358 | return GNUNET_OK; |
5354 | } | 5359 | } |
@@ -5356,6 +5361,7 @@ handle_dht_p2p_trail_teardown (void *cls, const struct GNUNET_PeerIdentity *peer | |||
5356 | { | 5361 | { |
5357 | /* If not final destination, then send a trail teardown message to next hop.*/ | 5362 | /* If not final destination, then send a trail teardown message to next hop.*/ |
5358 | GNUNET_assert (NULL != GNUNET_CONTAINER_multipeermap_get (friend_peermap, next_hop)); | 5363 | GNUNET_assert (NULL != GNUNET_CONTAINER_multipeermap_get (friend_peermap, next_hop)); |
5364 | FPRINTF (stderr,_("\nSUPU %s, %s, %d, REMOVE trail id = %s"),__FILE__, __func__,__LINE__,GNUNET_h2s(&trail_id)); | ||
5359 | GNUNET_assert (GNUNET_YES == GDS_ROUTING_remove_trail (trail_id)); | 5365 | GNUNET_assert (GNUNET_YES == GDS_ROUTING_remove_trail (trail_id)); |
5360 | GDS_NEIGHBOURS_send_trail_teardown (trail_id, trail_direction, *next_hop); | 5366 | GDS_NEIGHBOURS_send_trail_teardown (trail_id, trail_direction, *next_hop); |
5361 | } | 5367 | } |
@@ -5506,6 +5512,7 @@ remove_matching_trails (const struct GNUNET_PeerIdentity *disconnected_friend, | |||
5506 | { | 5512 | { |
5507 | GNUNET_assert (0 == (GNUNET_CRYPTO_cmp_peer_identity (disconnected_friend, | 5513 | GNUNET_assert (0 == (GNUNET_CRYPTO_cmp_peer_identity (disconnected_friend, |
5508 | next_hop))); | 5514 | next_hop))); |
5515 | FPRINTF (stderr,_("\nSUPU %s, %s, %d, REMOVE trail id = %s"),__FILE__, __func__,__LINE__,GNUNET_h2s(¤t_trail->trail_id)); | ||
5509 | GNUNET_assert (GNUNET_YES == GDS_ROUTING_remove_trail (current_trail->trail_id)); | 5516 | GNUNET_assert (GNUNET_YES == GDS_ROUTING_remove_trail (current_trail->trail_id)); |
5510 | } | 5517 | } |
5511 | matching_trails_count++; | 5518 | matching_trails_count++; |
@@ -5600,6 +5607,7 @@ handle_core_disconnect (void *cls, | |||
5600 | } | 5607 | } |
5601 | 5608 | ||
5602 | remove_matching_fingers (peer); | 5609 | remove_matching_fingers (peer); |
5610 | FPRINTF (stderr,_("\nSUPU %s, %s, %d, REMOVE trail id of peer %s"),__FILE__, __func__,__LINE__,GNUNET_i2s(peer)); | ||
5603 | GNUNET_assert (GNUNET_SYSERR != GDS_ROUTING_remove_trail_by_peer (peer)); | 5611 | GNUNET_assert (GNUNET_SYSERR != GDS_ROUTING_remove_trail_by_peer (peer)); |
5604 | GNUNET_assert (GNUNET_YES == | 5612 | GNUNET_assert (GNUNET_YES == |
5605 | GNUNET_CONTAINER_multipeermap_remove (friend_peermap, | 5613 | GNUNET_CONTAINER_multipeermap_remove (friend_peermap, |