aboutsummaryrefslogtreecommitdiff
path: root/src/or/rephist.c
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2011-10-24 12:51:00 +0200
committerSebastian Hahn <sebastian@torproject.org>2011-10-24 14:54:22 +0200
commitf885c605013bd72970159aad92ad9d9f64395a0c (patch)
tree925215acc78c3f466524848564d410e9d2c2022c /src/or/rephist.c
parent2e295ae46e29b6a7428867bc18882656d408f2e5 (diff)
downloadtor-f885c605013bd72970159aad92ad9d9f64395a0c.tar
tor-f885c605013bd72970159aad92ad9d9f64395a0c.tar.gz
Don't initialize desc stats for non-bridgedirauth nodes
Also make sure that calling rep_hist_note_desc_served() while stats aren't initialized just returns. Bug spotted by SwissTorHelp. Thanks!
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r--src/or/rephist.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 1aa0aeb2a..f8ebe644f 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -2712,6 +2712,8 @@ rep_hist_desc_stats_write(time_t now)
void
rep_hist_note_desc_served(const char * desc)
{
+ if (!served_descs)
+ return; // We're not collecting stats
digestmap_set(served_descs, desc, (void *)1);
total_descriptor_downloads++;
}