aboutsummaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2017-05-15 12:09:07 +0200
committerNick Mathewson <nickm@torproject.org>2017-05-15 17:21:55 -0400
commitae33deb91d204da0689f182a0899f9f11a5bb77a (patch)
treed998b81ee28dc26e5787d0043a2b5a49dfff6170 /src/or/directory.c
parent7591518d163de1367cd21e1fc610960ab83993e0 (diff)
downloadtor-ae33deb91d204da0689f182a0899f9f11a5bb77a.tar.gz
tor-ae33deb91d204da0689f182a0899f9f11a5bb77a.zip
Check for best consensus when no consensusdiff was found.
This patch ensures that we use the current consensus in the case where no consensus diff was found or a consensus diff wasn't requested. See: https://bugs.torproject.org/21667
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 4fa4b3c040..8ed1305b06 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -3815,11 +3815,14 @@ handle_get_current_consensus(dir_connection_t *conn,
&compression_used);
SMARTLIST_FOREACH(diff_from_digests, uint8_t *, d, tor_free(d));
smartlist_free(diff_from_digests);
- } else {
+ }
+
+ if (! cached_consensus) {
cached_consensus = find_best_consensus(flav,
args->compression_supported,
&compression_used);
}
+
time_t fresh_until, valid_until;
int have_fresh_until = 0, have_valid_until = 0;
if (cached_consensus) {