summaryrefslogtreecommitdiff
path: root/src/or/hs_cache.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-01-11 10:14:50 -0500
committerNick Mathewson <nickm@torproject.org>2017-01-11 10:14:50 -0500
commit7892683e7e491c32d1ea3c44d47877fe9ed7c850 (patch)
treee8a2ad05b0fa8fc7f8094cefda014d0a9e761f52 /src/or/hs_cache.c
parent8f893fbca92f1e190ac056a21abc9e4c1a29b236 (diff)
parente1d7661412325bb8c81a3a7f4d5cc25efdee5a78 (diff)
downloadtor-7892683e7e491c32d1ea3c44d47877fe9ed7c850.tar.gz
tor-7892683e7e491c32d1ea3c44d47877fe9ed7c850.zip
Merge remote-tracking branch 'asn/bug20852_v1'
Diffstat (limited to 'src/or/hs_cache.c')
-rw-r--r--src/or/hs_cache.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/hs_cache.c b/src/or/hs_cache.c
index e5bd0e49a7..43cd8c3258 100644
--- a/src/or/hs_cache.c
+++ b/src/or/hs_cache.c
@@ -15,6 +15,7 @@
#include "config.h"
#include "hs_common.h"
#include "hs_descriptor.h"
+#include "networkstatus.h"
#include "rendcache.h"
/* Directory descriptor cache. Map indexed by blinded key. */
@@ -366,6 +367,18 @@ hs_cache_handle_oom(time_t now, size_t min_remove_bytes)
return bytes_removed;
}
+/**
+ * Return the maximum size of an HS descriptor we are willing to accept as an
+ * HSDir.
+ */
+unsigned int
+hs_cache_get_max_descriptor_size(void)
+{
+ return (unsigned) networkstatus_get_param(NULL,
+ "HSV3MaxDescriptorSize",
+ HS_DESC_MAX_LEN, 1, INT32_MAX);
+}
+
/* Initialize the hidden service cache subsystem. */
void
hs_cache_init(void)