From c980be951157b68e6bd658ce01850e96ce97d422 Mon Sep 17 00:00:00 2001 From: George Kadianakis Date: Thu, 24 Aug 2017 16:17:26 +0300 Subject: prop224: Refactor descriptor reupload logic. We refactor the descriptor reupload logic to be similar to the v2 logic where we update a global 'consider_republishing_rend_descriptors' flag and then we use that to check for hash ring changes during the global hidden service callbacks. This fixes bugs where we would inspect the hash ring immediately as we receive new dirinfo (e.g. consensus) but before running the hidden service housekeeping events. That was leaving us in an inconsistent state wrt hsdir indices and causing bugs all around. --- src/test/test_hs_common.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/test/test_hs_common.c') diff --git a/src/test/test_hs_common.c b/src/test/test_hs_common.c index ec938ff5d1..b1e47adf24 100644 --- a/src/test/test_hs_common.c +++ b/src/test/test_hs_common.c @@ -626,12 +626,11 @@ test_desc_reupload_logic(void *arg) curr_hsdir_index, nickname, 1); } - /* Now call router_dir_info_changed() again and see that it detected the hash - ring change and updated the upload time */ + /* Now call service_desc_hsdirs_changed() and see that it detected the hash + ring change */ time_t now = approx_time(); tt_assert(now); - router_dir_info_changed(); - tt_int_op(desc->next_upload_time, OP_EQ, now); + tt_int_op(service_desc_hsdirs_changed(service, desc), OP_EQ, 1); /* Now pretend that the descriptor changed, and order a reupload to all HSDirs. Make sure that the set of previous HSDirs was cleared. */ -- cgit v1.2.3-54-g00ecf