summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2016-08-10 16:40:06 -0400
committerDavid Goulet <dgoulet@torproject.org>2016-11-04 10:32:49 -0400
commit1aeaba4906d9f0d8901f3ef928f2cbcd049f1140 (patch)
treecabcd4466e744bdf82b371ce336823dbbede6301 /src/or
parent025610612d78fe0a0ec95dd88c3d44e4bf643603 (diff)
downloadtor-1aeaba4906d9f0d8901f3ef928f2cbcd049f1140.tar.gz
tor-1aeaba4906d9f0d8901f3ef928f2cbcd049f1140.zip
test: Add prop224 directory cache unit tests
Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
Diffstat (limited to 'src/or')
-rw-r--r--src/or/hs_cache.c5
-rw-r--r--src/or/hs_cache.h6
2 files changed, 10 insertions, 1 deletions
diff --git a/src/or/hs_cache.c b/src/or/hs_cache.c
index c2e2914e5a..40730bd435 100644
--- a/src/or/hs_cache.c
+++ b/src/or/hs_cache.c
@@ -6,6 +6,9 @@
* \brief Handle hidden service descriptor caches.
**/
+/* For unit tests.*/
+#define HS_CACHE_PRIVATE
+
#include "hs_cache.h"
#include "or.h"
@@ -178,7 +181,7 @@ err:
* <b>global_cutoff</b> value. If <b>global_cutoff</b> is 0, the cleaning
* process will use the lifetime found in the plaintext data section. Return
* the number of bytes cleaned. */
-static size_t
+STATIC size_t
cache_clean_v3_as_dir(time_t now, time_t global_cutoff)
{
size_t bytes_removed = 0;
diff --git a/src/or/hs_cache.h b/src/or/hs_cache.h
index 3432d61b14..f0573175d3 100644
--- a/src/or/hs_cache.h
+++ b/src/or/hs_cache.h
@@ -50,4 +50,10 @@ int hs_cache_store_as_dir(const char *desc);
int hs_cache_lookup_as_dir(uint32_t version, const char *query,
char **desc_out);
+#ifdef HS_CACHE_PRIVATE
+
+STATIC size_t cache_clean_v3_as_dir(time_t now, time_t global_cutoff);
+
+#endif /* HS_CACHE_PRIVATE */
+
#endif /* TOR_HS_CACHE_H */