diff options
author | David Goulet <dgoulet@torproject.org> | 2017-09-01 16:18:50 -0400 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2017-09-07 18:16:07 +0300 |
commit | 72c7f81459e087e2a0485361eb34db1023d12155 (patch) | |
tree | d8f01ee1d12860ac5cff8f90fcaa93df7359265f /src/or/hs_service.c | |
parent | f117da3ea006fbdda3f5e921d5f8da2ae3d3bdfd (diff) | |
download | tor-72c7f81459e087e2a0485361eb34db1023d12155.tar.gz tor-72c7f81459e087e2a0485361eb34db1023d12155.zip |
prop224: When computing hsdir index and time period, use valid_after time
Use the valid_after time from the consensus to get the time period number else
we might get out of sync with the overlap period that uses valid_after.
Make it an optional feature since some functions require passing a
specific time (like hs_get_start_time_of_next_time_period()).
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/hs_service.c')
-rw-r--r-- | src/or/hs_service.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/hs_service.c b/src/or/hs_service.c index 706890e34f..49dfa2c4fe 100644 --- a/src/or/hs_service.c +++ b/src/or/hs_service.c @@ -1376,7 +1376,7 @@ build_all_descriptors(time_t now) /* This means we just booted up because else this descriptor will never * be NULL as it should always point to the descriptor that was in * desc_next after rotation. */ - build_service_descriptor(service, now, hs_get_time_period_num(now), + build_service_descriptor(service, now, hs_get_time_period_num(0), &service->desc_current); log_info(LD_REND, "Hidden service %s current descriptor successfully " @@ -1387,7 +1387,7 @@ build_all_descriptors(time_t now) * we are in the overlap period for the _next_ time period since it means * we either just booted or we just rotated our descriptors. */ if (hs_overlap_mode_is_active(NULL, now) && service->desc_next == NULL) { - build_service_descriptor(service, now, hs_get_next_time_period_num(now), + build_service_descriptor(service, now, hs_get_next_time_period_num(0), &service->desc_next); log_info(LD_REND, "Hidden service %s next descriptor successfully " "built. Now scheduled for upload.", |