diff options
Diffstat (limited to 'src/dht/gnunet-service-wdht_datacache.c')
-rw-r--r-- | src/dht/gnunet-service-wdht_datacache.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/dht/gnunet-service-wdht_datacache.c b/src/dht/gnunet-service-wdht_datacache.c index 6bf68028a..978c8f177 100644 --- a/src/dht/gnunet-service-wdht_datacache.c +++ b/src/dht/gnunet-service-wdht_datacache.c | |||
@@ -37,6 +37,12 @@ | |||
37 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__) | 37 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__) |
38 | 38 | ||
39 | /** | 39 | /** |
40 | * How many "closest" results to we return for migration when | ||
41 | * asked (at most)? | ||
42 | */ | ||
43 | #define NUM_CLOSEST 42 | ||
44 | |||
45 | /** | ||
40 | * Handle to the datacache service (for inserting/retrieving data) | 46 | * Handle to the datacache service (for inserting/retrieving data) |
41 | */ | 47 | */ |
42 | static struct GNUNET_DATACACHE_Handle *datacache; | 48 | static struct GNUNET_DATACACHE_Handle *datacache; |
@@ -424,6 +430,23 @@ GDS_DATACACHE_get_random_key (struct GNUNET_HashCode *key) | |||
424 | 430 | ||
425 | 431 | ||
426 | /** | 432 | /** |
433 | * Handle a request for data close to a key that we have received from | ||
434 | * another peer. | ||
435 | * | ||
436 | * @param key the location at which the peer is looking for data that is close | ||
437 | */ | ||
438 | void | ||
439 | GDS_DATACACHE_get_successors (const struct GNUNET_HashCode *key) | ||
440 | { | ||
441 | GNUNET_DATACACHE_get_closest (datacache, | ||
442 | key, | ||
443 | NUM_CLOSEST, | ||
444 | NULL /* FIXME */, | ||
445 | NULL); | ||
446 | } | ||
447 | |||
448 | |||
449 | /** | ||
427 | * Initialize datacache subsystem. | 450 | * Initialize datacache subsystem. |
428 | */ | 451 | */ |
429 | void | 452 | void |