aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendservice.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-01-12 10:46:15 -0500
committerNick Mathewson <nickm@torproject.org>2017-04-13 16:25:49 -0400
commit0565f5a3bb19cf1027de2093ba2fbaf7b937e2fb (patch)
treef90fc76dd9fdffcb21e78d9afa61991db1a290b3 /src/or/rendservice.h
parente7b7e99cc72e1db14bad471fef69729bdc5eea94 (diff)
downloadtor-0565f5a3bb19cf1027de2093ba2fbaf7b937e2fb.tar.gz
tor-0565f5a3bb19cf1027de2093ba2fbaf7b937e2fb.zip
hs: Make the service list pruning function public
The reason for making the temporary list public is to keep it encapsulated in the rendservice subsystem so the prop224 code does not have direct access to it and can only affect it through the rendservice pruning function. It also has been modified to not take list as arguments but rather use the global lists (main and temporary ones) because prop224 code will call it to actually prune the rendservice's lists. The function does the needed rotation of pointers between those lists and then prune if needed. In order to make the unit test work and not completely horrible, there is a "impl_" version of the function that doesn't free memory, it simply moves pointers around. It is directly used in the unit test and two setter functions for those lists' pointer have been added only for unit test. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/rendservice.h')
-rw-r--r--src/or/rendservice.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/rendservice.h b/src/or/rendservice.h
index 6f45f473a5..1583a6010b 100644
--- a/src/or/rendservice.h
+++ b/src/or/rendservice.h
@@ -133,13 +133,19 @@ STATIC ssize_t encode_establish_intro_cell_legacy(char *cell_body_out,
size_t cell_body_out_len,
crypto_pk_t *intro_key,
char *rend_circ_nonce);
-STATIC void prune_services_on_reload(smartlist_t *old_service_list,
- smartlist_t *new_service_list);
+#ifdef TOR_UNIT_TESTS
-#endif
+STATIC void set_rend_service_list(smartlist_t *new_list);
+STATIC void set_rend_rend_service_staging_list(smartlist_t *new_list);
+STATIC void rend_service_prune_list_impl_(void);
+
+#endif /* TOR_UNIT_TESTS */
+
+#endif /* RENDSERVICE_PRIVATE */
int num_rend_services(void);
int rend_config_services(const or_options_t *options, int validate_only);
+void rend_service_prune_list(void);
int rend_service_load_all_keys(const smartlist_t *service_list);
void rend_services_add_filenames_to_lists(smartlist_t *open_lst,
smartlist_t *stat_lst);