diff options
author | Supriti Singh <supritisingh08@gmail.com> | 2014-08-04 14:18:10 +0000 |
---|---|---|
committer | Supriti Singh <supritisingh08@gmail.com> | 2014-08-04 14:18:10 +0000 |
commit | 8e5e995d112c5bfb200ed7bf343dfccf010f1680 (patch) | |
tree | ce1b8f0915dfda8271da7925a53a89fef5b6d77a /src | |
parent | f70a3e885ab86875a3c1215d755e3f3dd0030a1b (diff) |
xvine:fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/dht/gnunet-service-xdht_clients.c | 1 | ||||
-rw-r--r-- | src/dht/gnunet-service-xdht_datacache.c | 1 | ||||
-rw-r--r-- | src/dht/gnunet-service-xdht_neighbours.c | 25 |
3 files changed, 19 insertions, 8 deletions
diff --git a/src/dht/gnunet-service-xdht_clients.c b/src/dht/gnunet-service-xdht_clients.c index fd806eff7d..8d877654a6 100644 --- a/src/dht/gnunet-service-xdht_clients.c +++ b/src/dht/gnunet-service-xdht_clients.c @@ -967,6 +967,7 @@ handle_dht_local_put (void *cls, struct GNUNET_SERVER_Client *client, memset(&best_known_destination, 0 , sizeof (struct GNUNET_PeerIdentity)); memset(&intermediate_trail_id, 0, sizeof (struct GNUNET_HashCode)); + GDS_NEIGHBOURS_send_put (&put_msg->key, ntohl (put_msg->type), ntohl (put_msg->options), ntohl (put_msg->desired_replication_level), diff --git a/src/dht/gnunet-service-xdht_datacache.c b/src/dht/gnunet-service-xdht_datacache.c index 6c3b8adeb6..a7952cc0c2 100644 --- a/src/dht/gnunet-service-xdht_datacache.c +++ b/src/dht/gnunet-service-xdht_datacache.c @@ -228,7 +228,6 @@ datacache_get_iterator (void *cls, i++; iterator = iterator->next; } - GDS_NEIGHBOURS_send_get_result (key,type, &(ctx->next_hop),&(ctx->source_peer), put_path_length, put_path, ctx->get_path_length, get_path, exp, data, size ); diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c index d0c37efb11..9782c3e9c8 100644 --- a/src/dht/gnunet-service-xdht_neighbours.c +++ b/src/dht/gnunet-service-xdht_neighbours.c @@ -71,7 +71,7 @@ /** * How long to wait before sending another verify successor message. */ -#define DHT_SEND_VERIFY_SUCCESSOR_INTERVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) +#define DHT_SEND_VERIFY_SUCCESSOR_INTERVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 1) /** * How long at most to wait for transmission of a request to a friend ? @@ -93,7 +93,7 @@ /** * Maximum number of trails stored per finger. */ -#define MAXIMUM_TRAILS_PER_FINGER 1 +#define MAXIMUM_TRAILS_PER_FINGER 4 /** * Finger map index for predecessor entry in finger table. @@ -971,10 +971,13 @@ process_friend_queue (struct FriendInfo *peer) struct P2PPendingMessage *pending; if (NULL == (pending = peer->head)) + { return; + } if (NULL != peer->th) + { return; - + } GNUNET_STATISTICS_update (GDS_stats, gettext_noop ("# Bytes of bandwidth requested from core"), @@ -1762,6 +1765,8 @@ test_friend_peermap_print () } } + + /** * This is a test function, to print all the entries of finger table. */ @@ -2152,7 +2157,7 @@ GDS_NEIGHBOURS_send_put (const struct GNUNET_HashCode *key, { /* I am the destination. */ GDS_DATACACHE_handle_put (expiration_time, key, 0, NULL, - ntohl (block_type),data_size,data); + block_type,data_size,data); return; } else @@ -2189,7 +2194,6 @@ GDS_NEIGHBOURS_send_put (const struct GNUNET_HashCode *key, sizeof (struct GNUNET_PeerIdentity) * put_path_length); } memcpy (&pp[put_path_length], data, data_size); - GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); target_friend->pending_count++; process_friend_queue (target_friend); @@ -3270,7 +3274,6 @@ get_finger_table_index (uint64_t ultimate_destination_finger_value, diff = ultimate_destination_finger_value - my_id64; finger_table_index = find_set_bit (diff); } - return finger_table_index; } @@ -3367,6 +3370,14 @@ finger_table_add (struct GNUNET_PeerIdentity finger_identity, current_search_finger_index = 0; return; } + struct FingerInfo *prev_finger; + prev_finger = &finger_table[finger_table_index - 1]; + if (0 == GNUNET_CRYPTO_cmp_peer_identity (&finger_identity, + &prev_finger->finger_identity)) + { + current_search_finger_index--; + return; + } } existing_finger = &finger_table[finger_table_index]; @@ -4000,7 +4011,7 @@ handle_dht_p2p_trail_setup (void *cls, const struct GNUNET_PeerIdentity *peer, target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, peer); else target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, &source); - if (NULL != target_friend) + if (NULL == target_friend) { GNUNET_break_op (0); return GNUNET_SYSERR; |