aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendcache.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@ev0ke.net>2015-06-25 15:11:40 -0400
committerNick Mathewson <nickm@torproject.org>2015-08-11 09:34:41 -0400
commitd06af95ba3fdcb0c9820dcf34146ba68458d5e46 (patch)
tree747404371194ba1812b320d94e6cd9db90dec737 /src/or/rendcache.c
parentab9a0e340728abd96128da726f67b4ccca10ba52 (diff)
downloadtor-d06af95ba3fdcb0c9820dcf34146ba68458d5e46.tar.gz
tor-d06af95ba3fdcb0c9820dcf34146ba68458d5e46.zip
Purge client HS failure cache on NEWNYM
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Diffstat (limited to 'src/or/rendcache.c')
-rw-r--r--src/or/rendcache.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/rendcache.c b/src/or/rendcache.c
index 7a86546b7a..acb9447de8 100644
--- a/src/or/rendcache.c
+++ b/src/or/rendcache.c
@@ -258,6 +258,18 @@ rend_cache_purge(void)
rend_cache = strmap_new();
}
+/** Remove ALL entries from the failure cache. This is also called when a
+ * NEWNYM signal is received. */
+void
+rend_cache_failure_purge(void)
+{
+ if (rend_cache_failure) {
+ log_info(LD_REND, "Purging HS failure cache");
+ strmap_free(rend_cache_failure, rend_cache_failure_entry_free_);
+ }
+ rend_cache_failure = strmap_new();
+}
+
/** Lookup the rend failure cache using a relay identity digest in
* <b>identity</b> and service ID <b>service_id</b>. If found, the intro
* failure is set in <b>intro_entry</b> else it stays untouched. Return 1