diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-06-03 15:07:09 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-06-03 15:07:09 +0200 |
commit | 18a1d4ec5085690d16345a52f3e75d059c834195 (patch) | |
tree | eddcbab91006a80cfa604c802bb1fccdaae1103d /src/dht | |
parent | 2e619a454b7c78aa5f592debd6c8a31e7d7c1143 (diff) | |
download | gnunet-18a1d4ec5085690d16345a52f3e75d059c834195.tar.gz gnunet-18a1d4ec5085690d16345a52f3e75d059c834195.zip |
proper datacache expiration by proximity first
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/gnunet-service-dht_datacache.c | 4 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.c | 2 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.h | 6 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/dht/gnunet-service-dht_datacache.c b/src/dht/gnunet-service-dht_datacache.c index 81b7184ed..07a666db6 100644 --- a/src/dht/gnunet-service-dht_datacache.c +++ b/src/dht/gnunet-service-dht_datacache.c | |||
@@ -85,8 +85,8 @@ GDS_DATACACHE_handle_put (struct GNUNET_TIME_Absolute expiration, | |||
85 | GNUNET_NO); | 85 | GNUNET_NO); |
86 | r = GNUNET_DATACACHE_put (datacache, | 86 | r = GNUNET_DATACACHE_put (datacache, |
87 | key, | 87 | key, |
88 | GDS_am_closest_peer (key, | 88 | GNUNET_CRYPTO_hash_matching_bits (key, |
89 | NULL), | 89 | &my_identity_hash), |
90 | data_size, | 90 | data_size, |
91 | data, | 91 | data, |
92 | type, | 92 | type, |
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index b120091af..94844374d 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c | |||
@@ -404,7 +404,7 @@ static struct GNUNET_PeerIdentity my_identity; | |||
404 | /** | 404 | /** |
405 | * Hash of the identity of this peer. | 405 | * Hash of the identity of this peer. |
406 | */ | 406 | */ |
407 | static struct GNUNET_HashCode my_identity_hash; | 407 | struct GNUNET_HashCode my_identity_hash; |
408 | 408 | ||
409 | /** | 409 | /** |
410 | * Handle to CORE. | 410 | * Handle to CORE. |
diff --git a/src/dht/gnunet-service-dht_neighbours.h b/src/dht/gnunet-service-dht_neighbours.h index bb1867fe9..bf3ed80a2 100644 --- a/src/dht/gnunet-service-dht_neighbours.h +++ b/src/dht/gnunet-service-dht_neighbours.h | |||
@@ -32,6 +32,12 @@ | |||
32 | #include "gnunet_dht_service.h" | 32 | #include "gnunet_dht_service.h" |
33 | 33 | ||
34 | /** | 34 | /** |
35 | * Hash of the identity of this peer. | ||
36 | */ | ||
37 | extern struct GNUNET_HashCode my_identity_hash; | ||
38 | |||
39 | |||
40 | /** | ||
35 | * Perform a PUT operation. Forwards the given request to other | 41 | * Perform a PUT operation. Forwards the given request to other |
36 | * peers. Does not store the data locally. Does not give the | 42 | * peers. Does not store the data locally. Does not give the |
37 | * data to local clients. May do nothing if this is the only | 43 | * data to local clients. May do nothing if this is the only |