diff options
author | David Goulet <dgoulet@ev0ke.net> | 2016-03-29 15:08:04 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2016-11-04 10:31:35 -0400 |
commit | 025610612d78fe0a0ec95dd88c3d44e4bf643603 (patch) | |
tree | 165a149fe0534bb58711aa61c4b2c622e7c87b25 /src/or/relay.c | |
parent | 473f99bf7bdb7d23b914cd1b590451333baaf7fe (diff) | |
download | tor-025610612d78fe0a0ec95dd88c3d44e4bf643603.tar.gz tor-025610612d78fe0a0ec95dd88c3d44e4bf643603.zip |
prop224: Directory cache support
This implements the proposal 224 directory descriptor cache store and lookup
functionalities. Furthermore, it merges the OOM call for the HSDir cache with
current protocol v2 and the new upcoming v3.
Add hs_cache.{c|h} with store/lookup API.
Closes #18572
Signed-off-by: David Goulet <dgoulet@torproject.org>
Signed-off-by: George Kadianakis <desnacked@riseup.net>
Diffstat (limited to 'src/or/relay.c')
-rw-r--r-- | src/or/relay.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/or/relay.c b/src/or/relay.c index 38096ad1bb..e2963e3288 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -25,6 +25,7 @@ #include "connection_or.h" #include "control.h" #include "geoip.h" +#include "hs_cache.h" #include "main.h" #include "networkstatus.h" #include "nodelist.h" @@ -2404,9 +2405,7 @@ cell_queues_check_size(void) if (rend_cache_total > get_options()->MaxMemInQueues / 5) { const size_t bytes_to_remove = rend_cache_total - (size_t)(get_options()->MaxMemInQueues / 10); - rend_cache_clean_v2_descs_as_dir(time(NULL), bytes_to_remove); - alloc -= rend_cache_total; - alloc += rend_cache_get_total_allocation(); + alloc -= hs_cache_handle_oom(time(NULL), bytes_to_remove); } circuits_handle_oom(alloc); return 1; |