diff options
author | George Kadianakis <desnacked@riseup.net> | 2016-12-23 14:48:05 +0200 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2017-01-09 15:02:56 +0200 |
commit | e1d7661412325bb8c81a3a7f4d5cc25efdee5a78 (patch) | |
tree | 333dc5ef254638d6ba72a42cf18f9268fd5ad626 /src/or/hs_cache.c | |
parent | 7456677a50d1c4c9f0f2e6b63259905f694d329a (diff) | |
download | tor-e1d7661412325bb8c81a3a7f4d5cc25efdee5a78.tar.gz tor-e1d7661412325bb8c81a3a7f4d5cc25efdee5a78.zip |
Max HS descriptor size is now 50kb and also consensus param.
Diffstat (limited to 'src/or/hs_cache.c')
-rw-r--r-- | src/or/hs_cache.c | 13 |
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) |