diff options
Diffstat (limited to 'src/dht/gnunet-service-dht_neighbours.c')
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index 908575735..889ef25ba 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c | |||
@@ -313,7 +313,7 @@ struct PeerInfo | |||
313 | struct PeerInfo *prev; | 313 | struct PeerInfo *prev; |
314 | 314 | ||
315 | /** | 315 | /** |
316 | * Count of outstanding messages for peer. | 316 | * Count of outstanding messages for peer. |
317 | */ | 317 | */ |
318 | unsigned int pending_count; | 318 | unsigned int pending_count; |
319 | 319 | ||
@@ -553,8 +553,8 @@ struct BloomConstructorContext | |||
553 | * @return #GNUNET_YES (we should continue to iterate) | 553 | * @return #GNUNET_YES (we should continue to iterate) |
554 | */ | 554 | */ |
555 | static int | 555 | static int |
556 | add_known_to_bloom (void *cls, | 556 | add_known_to_bloom (void *cls, |
557 | const struct GNUNET_PeerIdentity *key, | 557 | const struct GNUNET_PeerIdentity *key, |
558 | void *value) | 558 | void *value) |
559 | { | 559 | { |
560 | struct BloomConstructorContext *ctx = cls; | 560 | struct BloomConstructorContext *ctx = cls; |
@@ -649,7 +649,7 @@ handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
649 | /* Check for connect to self message */ | 649 | /* Check for connect to self message */ |
650 | if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity))) | 650 | if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity))) |
651 | return; | 651 | return; |
652 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 652 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
653 | "Connected to %s\n", | 653 | "Connected to %s\n", |
654 | GNUNET_i2s (peer)); | 654 | GNUNET_i2s (peer)); |
655 | if (GNUNET_YES == | 655 | if (GNUNET_YES == |
@@ -714,7 +714,7 @@ handle_core_disconnect (void *cls, | |||
714 | /* Check for disconnect from self message */ | 714 | /* Check for disconnect from self message */ |
715 | if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity))) | 715 | if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity))) |
716 | return; | 716 | return; |
717 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 717 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
718 | "Disconnected %s\n", | 718 | "Disconnected %s\n", |
719 | GNUNET_i2s (peer)); | 719 | GNUNET_i2s (peer)); |
720 | to_remove = | 720 | to_remove = |
@@ -919,14 +919,14 @@ get_forward_count (uint32_t hop_count, uint32_t target_replication) | |||
919 | * Differences in the lower bits must count stronger than differences | 919 | * Differences in the lower bits must count stronger than differences |
920 | * in the higher bits. | 920 | * in the higher bits. |
921 | * | 921 | * |
922 | * @param target | 922 | * @param target |
923 | * @param have | 923 | * @param have |
924 | * @return 0 if have==target, otherwise a number | 924 | * @return 0 if have==target, otherwise a number |
925 | * that is larger as the distance between | 925 | * that is larger as the distance between |
926 | * the two hash codes increases | 926 | * the two hash codes increases |
927 | */ | 927 | */ |
928 | static unsigned int | 928 | static unsigned int |
929 | get_distance (const struct GNUNET_HashCode *target, | 929 | get_distance (const struct GNUNET_HashCode *target, |
930 | const struct GNUNET_HashCode *have) | 930 | const struct GNUNET_HashCode *have) |
931 | { | 931 | { |
932 | unsigned int bucket; | 932 | unsigned int bucket; |
@@ -1197,7 +1197,7 @@ get_target_peers (const struct GNUNET_HashCode *key, | |||
1197 | struct GNUNET_HashCode nhash; | 1197 | struct GNUNET_HashCode nhash; |
1198 | 1198 | ||
1199 | GNUNET_assert (NULL != bloom); | 1199 | GNUNET_assert (NULL != bloom); |
1200 | ret = get_forward_count (hop_count, target_replication); | 1200 | ret = get_forward_count (hop_count, target_replication); |
1201 | if (0 == ret) | 1201 | if (0 == ret) |
1202 | { | 1202 | { |
1203 | *targets = NULL; | 1203 | *targets = NULL; |
@@ -1231,7 +1231,7 @@ get_target_peers (const struct GNUNET_HashCode *key, | |||
1231 | *targets = rtargets; | 1231 | *targets = rtargets; |
1232 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1232 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1233 | "Forwarding query `%s' to %u peers (goal was %u peers)\n", | 1233 | "Forwarding query `%s' to %u peers (goal was %u peers)\n", |
1234 | GNUNET_h2s (key), | 1234 | GNUNET_h2s (key), |
1235 | off, | 1235 | off, |
1236 | ret); | 1236 | ret); |
1237 | return off; | 1237 | return off; |
@@ -1601,7 +1601,7 @@ core_init (void *cls, | |||
1601 | * #GNUNET_SYSERR to close it (signal serious error) | 1601 | * #GNUNET_SYSERR to close it (signal serious error) |
1602 | */ | 1602 | */ |
1603 | static int | 1603 | static int |
1604 | handle_dht_p2p_put (void *cls, | 1604 | handle_dht_p2p_put (void *cls, |
1605 | const struct GNUNET_PeerIdentity *peer, | 1605 | const struct GNUNET_PeerIdentity *peer, |
1606 | const struct GNUNET_MessageHeader *message) | 1606 | const struct GNUNET_MessageHeader *message) |
1607 | { | 1607 | { |
@@ -1654,7 +1654,7 @@ handle_dht_p2p_put (void *cls, | |||
1654 | 1654 | ||
1655 | tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); | 1655 | tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); |
1656 | LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, | 1656 | LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, |
1657 | "XDHT PUT %s: %s->%s (%u, %u=>%u)\n", | 1657 | "XDHT PUT %s: %s->%s (%u, %u=>%u)\n", |
1658 | GNUNET_h2s (&put->key), GNUNET_i2s (peer), tmp, | 1658 | GNUNET_h2s (&put->key), GNUNET_i2s (peer), tmp, |
1659 | ntohl(put->hop_count), | 1659 | ntohl(put->hop_count), |
1660 | GNUNET_CRYPTO_hash_matching_bits (&phash, &put->key), | 1660 | GNUNET_CRYPTO_hash_matching_bits (&phash, &put->key), |
@@ -1913,7 +1913,7 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1913 | 1913 | ||
1914 | tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); | 1914 | tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); |
1915 | LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, | 1915 | LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, |
1916 | "XDHT GET %s: %s->%s (%u, %u=>%u) xq: %.*s\n", | 1916 | "XDHT GET %s: %s->%s (%u, %u=>%u) xq: %.*s\n", |
1917 | GNUNET_h2s (&get->key), GNUNET_i2s (peer), tmp, | 1917 | GNUNET_h2s (&get->key), GNUNET_i2s (peer), tmp, |
1918 | ntohl(get->hop_count), | 1918 | ntohl(get->hop_count), |
1919 | GNUNET_CRYPTO_hash_matching_bits (&phash, &get->key), | 1919 | GNUNET_CRYPTO_hash_matching_bits (&phash, &get->key), |
@@ -2059,7 +2059,7 @@ handle_dht_p2p_result (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
2059 | char *tmp; | 2059 | char *tmp; |
2060 | 2060 | ||
2061 | tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); | 2061 | tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); |
2062 | LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, "XDHT RESULT %s: %s->%s (%u)\n", | 2062 | LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, "XDHT RESULT %s: %s->%s (%u)\n", |
2063 | GNUNET_h2s (&prm->key), GNUNET_i2s (peer), tmp, | 2063 | GNUNET_h2s (&prm->key), GNUNET_i2s (peer), tmp, |
2064 | get_path_length + 1); | 2064 | get_path_length + 1); |
2065 | GNUNET_free (tmp); | 2065 | GNUNET_free (tmp); |
@@ -2132,10 +2132,10 @@ handle_dht_p2p_result (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
2132 | struct GNUNET_PeerIdentity xput_path[get_path_length + 1 + put_path_length]; | 2132 | struct GNUNET_PeerIdentity xput_path[get_path_length + 1 + put_path_length]; |
2133 | 2133 | ||
2134 | memcpy (xput_path, put_path, put_path_length * sizeof (struct GNUNET_PeerIdentity)); | 2134 | memcpy (xput_path, put_path, put_path_length * sizeof (struct GNUNET_PeerIdentity)); |
2135 | memcpy (&xput_path[put_path_length], | 2135 | memcpy (&xput_path[put_path_length], |
2136 | xget_path, | 2136 | xget_path, |
2137 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); | 2137 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); |
2138 | 2138 | ||
2139 | GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (prm->expiration_time), | 2139 | GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (prm->expiration_time), |
2140 | &prm->key, | 2140 | &prm->key, |
2141 | get_path_length + put_path_length, xput_path, | 2141 | get_path_length + put_path_length, xput_path, |
@@ -2214,7 +2214,7 @@ GDS_NEIGHBOURS_done () | |||
2214 | 2214 | ||
2215 | /** | 2215 | /** |
2216 | * Get the ID of the local node. | 2216 | * Get the ID of the local node. |
2217 | * | 2217 | * |
2218 | * @return identity of the local node | 2218 | * @return identity of the local node |
2219 | */ | 2219 | */ |
2220 | struct GNUNET_PeerIdentity * | 2220 | struct GNUNET_PeerIdentity * |