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) | |
download | gnunet-8e5e995d112c5bfb200ed7bf343dfccf010f1680.tar.gz gnunet-8e5e995d112c5bfb200ed7bf343dfccf010f1680.zip |
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 fd806eff7..8d877654a 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, | |||
967 | 967 | ||
968 | memset(&best_known_destination, 0 , sizeof (struct GNUNET_PeerIdentity)); | 968 | memset(&best_known_destination, 0 , sizeof (struct GNUNET_PeerIdentity)); |
969 | memset(&intermediate_trail_id, 0, sizeof (struct GNUNET_HashCode)); | 969 | memset(&intermediate_trail_id, 0, sizeof (struct GNUNET_HashCode)); |
970 | |||
970 | GDS_NEIGHBOURS_send_put (&put_msg->key, | 971 | GDS_NEIGHBOURS_send_put (&put_msg->key, |
971 | ntohl (put_msg->type), ntohl (put_msg->options), | 972 | ntohl (put_msg->type), ntohl (put_msg->options), |
972 | ntohl (put_msg->desired_replication_level), | 973 | 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 6c3b8adeb..a7952cc0c 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, | |||
228 | i++; | 228 | i++; |
229 | iterator = iterator->next; | 229 | iterator = iterator->next; |
230 | } | 230 | } |
231 | |||
232 | GDS_NEIGHBOURS_send_get_result (key,type, &(ctx->next_hop),&(ctx->source_peer), | 231 | GDS_NEIGHBOURS_send_get_result (key,type, &(ctx->next_hop),&(ctx->source_peer), |
233 | put_path_length, put_path, ctx->get_path_length, | 232 | put_path_length, put_path, ctx->get_path_length, |
234 | get_path, exp, data, size ); | 233 | get_path, exp, data, size ); |
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c index d0c37efb1..9782c3e9c 100644 --- a/src/dht/gnunet-service-xdht_neighbours.c +++ b/src/dht/gnunet-service-xdht_neighbours.c | |||
@@ -71,7 +71,7 @@ | |||
71 | /** | 71 | /** |
72 | * How long to wait before sending another verify successor message. | 72 | * How long to wait before sending another verify successor message. |
73 | */ | 73 | */ |
74 | #define DHT_SEND_VERIFY_SUCCESSOR_INTERVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) | 74 | #define DHT_SEND_VERIFY_SUCCESSOR_INTERVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 1) |
75 | 75 | ||
76 | /** | 76 | /** |
77 | * How long at most to wait for transmission of a request to a friend ? | 77 | * How long at most to wait for transmission of a request to a friend ? |
@@ -93,7 +93,7 @@ | |||
93 | /** | 93 | /** |
94 | * Maximum number of trails stored per finger. | 94 | * Maximum number of trails stored per finger. |
95 | */ | 95 | */ |
96 | #define MAXIMUM_TRAILS_PER_FINGER 1 | 96 | #define MAXIMUM_TRAILS_PER_FINGER 4 |
97 | 97 | ||
98 | /** | 98 | /** |
99 | * Finger map index for predecessor entry in finger table. | 99 | * Finger map index for predecessor entry in finger table. |
@@ -971,10 +971,13 @@ process_friend_queue (struct FriendInfo *peer) | |||
971 | struct P2PPendingMessage *pending; | 971 | struct P2PPendingMessage *pending; |
972 | 972 | ||
973 | if (NULL == (pending = peer->head)) | 973 | if (NULL == (pending = peer->head)) |
974 | { | ||
974 | return; | 975 | return; |
976 | } | ||
975 | if (NULL != peer->th) | 977 | if (NULL != peer->th) |
978 | { | ||
976 | return; | 979 | return; |
977 | 980 | } | |
978 | GNUNET_STATISTICS_update (GDS_stats, | 981 | GNUNET_STATISTICS_update (GDS_stats, |
979 | gettext_noop | 982 | gettext_noop |
980 | ("# Bytes of bandwidth requested from core"), | 983 | ("# Bytes of bandwidth requested from core"), |
@@ -1762,6 +1765,8 @@ test_friend_peermap_print () | |||
1762 | } | 1765 | } |
1763 | } | 1766 | } |
1764 | 1767 | ||
1768 | |||
1769 | |||
1765 | /** | 1770 | /** |
1766 | * This is a test function, to print all the entries of finger table. | 1771 | * This is a test function, to print all the entries of finger table. |
1767 | */ | 1772 | */ |
@@ -2152,7 +2157,7 @@ GDS_NEIGHBOURS_send_put (const struct GNUNET_HashCode *key, | |||
2152 | { | 2157 | { |
2153 | /* I am the destination. */ | 2158 | /* I am the destination. */ |
2154 | GDS_DATACACHE_handle_put (expiration_time, key, 0, NULL, | 2159 | GDS_DATACACHE_handle_put (expiration_time, key, 0, NULL, |
2155 | ntohl (block_type),data_size,data); | 2160 | block_type,data_size,data); |
2156 | return; | 2161 | return; |
2157 | } | 2162 | } |
2158 | else | 2163 | else |
@@ -2189,7 +2194,6 @@ GDS_NEIGHBOURS_send_put (const struct GNUNET_HashCode *key, | |||
2189 | sizeof (struct GNUNET_PeerIdentity) * put_path_length); | 2194 | sizeof (struct GNUNET_PeerIdentity) * put_path_length); |
2190 | } | 2195 | } |
2191 | memcpy (&pp[put_path_length], data, data_size); | 2196 | memcpy (&pp[put_path_length], data, data_size); |
2192 | |||
2193 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); | 2197 | GNUNET_CONTAINER_DLL_insert_tail (target_friend->head, target_friend->tail, pending); |
2194 | target_friend->pending_count++; | 2198 | target_friend->pending_count++; |
2195 | process_friend_queue (target_friend); | 2199 | process_friend_queue (target_friend); |
@@ -3270,7 +3274,6 @@ get_finger_table_index (uint64_t ultimate_destination_finger_value, | |||
3270 | diff = ultimate_destination_finger_value - my_id64; | 3274 | diff = ultimate_destination_finger_value - my_id64; |
3271 | finger_table_index = find_set_bit (diff); | 3275 | finger_table_index = find_set_bit (diff); |
3272 | } | 3276 | } |
3273 | |||
3274 | return finger_table_index; | 3277 | return finger_table_index; |
3275 | } | 3278 | } |
3276 | 3279 | ||
@@ -3367,6 +3370,14 @@ finger_table_add (struct GNUNET_PeerIdentity finger_identity, | |||
3367 | current_search_finger_index = 0; | 3370 | current_search_finger_index = 0; |
3368 | return; | 3371 | return; |
3369 | } | 3372 | } |
3373 | struct FingerInfo *prev_finger; | ||
3374 | prev_finger = &finger_table[finger_table_index - 1]; | ||
3375 | if (0 == GNUNET_CRYPTO_cmp_peer_identity (&finger_identity, | ||
3376 | &prev_finger->finger_identity)) | ||
3377 | { | ||
3378 | current_search_finger_index--; | ||
3379 | return; | ||
3380 | } | ||
3370 | } | 3381 | } |
3371 | 3382 | ||
3372 | existing_finger = &finger_table[finger_table_index]; | 3383 | existing_finger = &finger_table[finger_table_index]; |
@@ -4000,7 +4011,7 @@ handle_dht_p2p_trail_setup (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
4000 | target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, peer); | 4011 | target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, peer); |
4001 | else | 4012 | else |
4002 | target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, &source); | 4013 | target_friend = GNUNET_CONTAINER_multipeermap_get (friend_peermap, &source); |
4003 | if (NULL != target_friend) | 4014 | if (NULL == target_friend) |
4004 | { | 4015 | { |
4005 | GNUNET_break_op (0); | 4016 | GNUNET_break_op (0); |
4006 | return GNUNET_SYSERR; | 4017 | return GNUNET_SYSERR; |