aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSupriti Singh <supritisingh08@gmail.com>2014-08-20 09:17:55 +0000
committerSupriti Singh <supritisingh08@gmail.com>2014-08-20 09:17:55 +0000
commit3a97e98e8036bf1652562715b4b4bff4193efb4e (patch)
tree0f81d990a0faba908c3f3bc239ea2a5589c605b4 /src
parent72897db4838c7fc21818ebeaa20fc6a5b817bdcb (diff)
downloadgnunet-3a97e98e8036bf1652562715b4b4bff4193efb4e.tar.gz
gnunet-3a97e98e8036bf1652562715b4b4bff4193efb4e.zip
xvine: fixes
Diffstat (limited to 'src')
-rw-r--r--src/dht/gnunet-service-xdht_neighbours.c61
1 files changed, 37 insertions, 24 deletions
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c
index f42819aa5..b13c7bc3c 100644
--- a/src/dht/gnunet-service-xdht_neighbours.c
+++ b/src/dht/gnunet-service-xdht_neighbours.c
@@ -75,12 +75,12 @@
75/** 75/**
76 * How long to wait before sending another find finger trail request 76 * How long to wait before sending another find finger trail request
77 */ 77 */
78#define DHT_FIND_FINGER_TRAIL_INTERVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 50) 78#define DHT_FIND_FINGER_TRAIL_INTERVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 500)
79 79
80/** 80/**
81 * How long to wait before sending another verify successor message. 81 * How long to wait before sending another verify successor message.
82 */ 82 */
83#define DHT_SEND_VERIFY_SUCCESSOR_INTERVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 5) 83#define DHT_SEND_VERIFY_SUCCESSOR_INTERVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 60)
84 84
85/** 85/**
86 * How long at most to wait for transmission of a request to a friend ? 86 * How long at most to wait for transmission of a request to a friend ?
@@ -3499,7 +3499,29 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer,
3499 return GNUNET_OK; 3499 return GNUNET_OK;
3500 } 3500 }
3501 } 3501 }
3502 3502
3503 /* Check if you are already a part of put path. */
3504 unsigned int i;
3505 for (i = 0; i < putlen; i++)
3506 {
3507 if(0 == GNUNET_CRYPTO_cmp_peer_identity (&my_identity, &put_path[i]))
3508 {
3509 putlen = i;
3510 break;
3511 }
3512 }
3513
3514 /* Add yourself to the list. */
3515 struct GNUNET_PeerIdentity pp[putlen + 1];
3516 if (0 != (options & GNUNET_DHT_RO_RECORD_ROUTE))
3517 {
3518 memcpy (pp, put_path, putlen * sizeof (struct GNUNET_PeerIdentity));
3519 pp[putlen] = my_identity;
3520 putlen++;
3521 }
3522 else
3523 putlen = 0;
3524
3503 memcpy (&key_value, &(put->key), sizeof (uint64_t)); 3525 memcpy (&key_value, &(put->key), sizeof (uint64_t));
3504 if (0 != (GNUNET_CRYPTO_cmp_peer_identity (&best_known_dest, &my_identity))) 3526 if (0 != (GNUNET_CRYPTO_cmp_peer_identity (&best_known_dest, &my_identity)))
3505 { 3527 {
@@ -3513,9 +3535,20 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer,
3513 gettext_noop ("# Next hop to forward the packet not found " 3535 gettext_noop ("# Next hop to forward the packet not found "
3514 "trail setup request, packet dropped."), 3536 "trail setup request, packet dropped."),
3515 1, GNUNET_NO); 3537 1, GNUNET_NO);
3538
3516 GNUNET_break_op (0); 3539 GNUNET_break_op (0);
3540 //FIXME: Adding put here,only to ensure that process does not hang. but
3541 // should not be here. fix the logic.
3542 GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (put->expiration_time),
3543 &(put->key),putlen, pp, ntohl (put->block_type),
3544 payload_size, payload);
3517 return GNUNET_OK; 3545 return GNUNET_OK;
3518 } 3546 }
3547 else
3548 {
3549 GNUNET_assert (0 != GNUNET_CRYPTO_cmp_peer_identity (&my_identity,
3550 next_hop));
3551 }
3519 } 3552 }
3520 else 3553 else
3521 { 3554 {
@@ -3528,27 +3561,7 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer,
3528 best_known_dest = successor.best_known_destination; 3561 best_known_dest = successor.best_known_destination;
3529 } 3562 }
3530 3563
3531 /* Check if you are already a part of put path. */ 3564
3532 unsigned int i;
3533 for (i = 0; i < putlen; i++)
3534 {
3535 if(0 == GNUNET_CRYPTO_cmp_peer_identity (&my_identity, &put_path[i]))
3536 {
3537 putlen = i;
3538 break;
3539 }
3540 }
3541
3542 /* Add yourself to the list. */
3543 struct GNUNET_PeerIdentity pp[putlen + 1];
3544 if (0 != (options & GNUNET_DHT_RO_RECORD_ROUTE))
3545 {
3546 memcpy (pp, put_path, putlen * sizeof (struct GNUNET_PeerIdentity));
3547 pp[putlen] = my_identity;
3548 putlen++;
3549 }
3550 else
3551 putlen = 0;
3552 3565
3553 GDS_CLIENTS_process_put (options, 3566 GDS_CLIENTS_process_put (options,
3554 ntohl (put->block_type), 3567 ntohl (put->block_type),