From 07f2940b4519d801eb10b9f5e49790aced1f6322 Mon Sep 17 00:00:00 2001 From: Alexander Færøy Date: Fri, 23 Jun 2017 23:55:54 +0000 Subject: Set published_out for consensus cache entries in spooled_resource_estimate_size(). This patch ensures that the published_out output parameter is set to the current consensus cache entry's "valid after" field. See: https://bugs.torproject.org/22702 --- src/or/dirserv.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/or/dirserv.c') diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 408f58b22b..4954471c6a 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -14,6 +14,7 @@ #include "connection.h" #include "connection_or.h" #include "conscache.h" +#include "consdiffmgr.h" #include "control.h" #include "directory.h" #include "dirserv.h" @@ -3518,6 +3519,11 @@ spooled_resource_estimate_size(const spooled_resource_t *spooled, } else { cached_dir_t *cached; if (spooled->consensus_cache_entry) { + if (published_out) { + consensus_cache_entry_get_valid_after( + spooled->consensus_cache_entry, published_out); + } + return spooled->cce_len; } if (spooled->cached_dir_ref) { -- cgit v1.2.3-54-g00ecf