aboutsummaryrefslogtreecommitdiff
path: root/src/or/hs_cache.c
diff options
context:
space:
mode:
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 b7ff979e5b..6e23a74d68 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)