diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-03-13 15:38:20 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-03-28 19:55:03 +0200 |
commit | 8aa69a1b69b64185333fb1b6e74d55fc5e341fd8 (patch) | |
tree | 376215dbef2ca72b2638956fabd14f6294c33bbc /src/or/microdesc.c | |
parent | 8587f663ee5f8f4af4fbbd5542116eb22ed1814e (diff) | |
download | tor-8aa69a1b69b64185333fb1b6e74d55fc5e341fd8.tar.gz tor-8aa69a1b69b64185333fb1b6e74d55fc5e341fd8.zip |
Refactor the directory spool implementation
The old implementation had duplicated code in a bunch of places, and
it interspersed spool-management with resource management. The new
implementation should make it easier to add new resource types and
maintain the spooling code.
Closing ticket 21651.
Diffstat (limited to 'src/or/microdesc.c')
-rw-r--r-- | src/or/microdesc.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/or/microdesc.c b/src/or/microdesc.c index 140117f683..b9b0e83ce9 100644 --- a/src/or/microdesc.c +++ b/src/or/microdesc.c @@ -804,18 +804,6 @@ microdesc_cache_lookup_by_digest256(microdesc_cache_t *cache, const char *d) return md; } -/** Return the mean size of decriptors added to <b>cache</b> since it was last - * cleared. Used to estimate the size of large downloads. */ -size_t -microdesc_average_size(microdesc_cache_t *cache) -{ - if (!cache) - cache = get_microdesc_cache(); - if (!cache->n_seen) - return 512; - return (size_t)(cache->total_len_seen / cache->n_seen); -} - /** Return a smartlist of all the sha256 digest of the microdescriptors that * are listed in <b>ns</b> but not present in <b>cache</b>. Returns pointers * to internals of <b>ns</b>; you should not free the members of the resulting |