diff options
author | David Goulet <dgoulet@torproject.org> | 2018-02-02 10:15:28 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2018-02-02 14:48:41 -0500 |
commit | 51839f47650463f59bd2cc84da05d5bc535d699d (patch) | |
tree | 0d75973ecb70a578e0c9db02fe1643e0afaabf61 /src/or/geoip.h | |
parent | a2aaf9509ba578f4e7705b506ee9a0f764d24ff2 (diff) | |
download | tor-51839f47650463f59bd2cc84da05d5bc535d699d.tar.gz tor-51839f47650463f59bd2cc84da05d5bc535d699d.zip |
geoip: Hook the client history cache into the OOM handler
If the cache is using 20% of our maximum allowed memory, clean 10% of it. Same
behavior as the HS descriptor cache.
Closes #25122
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/geoip.h')
-rw-r--r-- | src/or/geoip.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/geoip.h b/src/or/geoip.h index 070296dd07..42d0c1cfd9 100644 --- a/src/or/geoip.h +++ b/src/or/geoip.h @@ -33,6 +33,8 @@ void geoip_note_client_seen(geoip_client_action_t action, const tor_addr_t *addr, const char *transport_name, time_t now); void geoip_remove_old_clients(time_t cutoff); +size_t geoip_client_cache_total_allocation(void); +size_t geoip_client_cache_handle_oom(time_t now, size_t min_remove_bytes); void geoip_note_ns_response(geoip_ns_response_t response); char *geoip_get_transport_history(void); |