Func rename: Make it clear that update_all_descriptors() does intro points.

With the new refresh_service_descriptor() function we had both
refresh_service_descriptor() and update_service_descriptor() which is basically
the same thing.

This commit renames update_service_descriptor() to
update_service_descriptor_intro_points() to make it clear it's not a generic
refresh and it's only about intro points.

Commit changes no code.
This commit is contained in:
George Kadianakis 2018-10-23 16:35:02 +03:00
parent 81c466c34a
commit 29c194e022
3 changed files with 14 additions and 15 deletions

View File

@ -2293,12 +2293,9 @@ service_desc_schedule_upload(hs_service_descriptor_t *desc,
}
}
/* Update the given descriptor from the given service. The possible update
* actions includes:
* - Picking missing intro points if needed.
*/
/* Pick missing intro points for this descriptor if needed. */
static void
update_service_descriptor(hs_service_t *service,
update_service_descriptor_intro_points(hs_service_t *service,
hs_service_descriptor_t *desc, time_t now)
{
unsigned int num_intro_points;
@ -2337,15 +2334,17 @@ update_service_descriptor(hs_service_t *service,
}
}
/* Update descriptors for each service if needed. */
/* Update descriptor intro points for each service if needed. We do this as
* part of the periodic event because we need to establish intro point circuits
* before we publish descriptors. */
STATIC void
update_all_descriptors(time_t now)
update_all_descriptors_intro_points(time_t now)
{
FOR_EACH_SERVICE_BEGIN(service) {
/* We'll try to update each descriptor that is if certain conditions apply
* in order for the descriptor to be updated. */
FOR_EACH_DESCRIPTOR_BEGIN(service, desc) {
update_service_descriptor(service, desc, now);
update_service_descriptor_intro_points(service, desc, now);
} FOR_EACH_DESCRIPTOR_END;
} FOR_EACH_SERVICE_END;
}
@ -2630,10 +2629,10 @@ run_build_descriptor_event(time_t now)
* been rotated or we just started up. */
build_all_descriptors(now);
/* Finally, we'll check if we should update the descriptors. Missing
* introduction points will be picked in this function which is useful for
* newly built descriptors. */
update_all_descriptors(now);
/* Finally, we'll check if we should update the descriptors' intro
* points. Missing introduction points will be picked in this function which
* is useful for newly built descriptors. */
update_all_descriptors_intro_points(now);
}
/* For the given service, launch any intro point circuits that could be

View File

@ -387,7 +387,7 @@ STATIC int intro_point_should_expire(const hs_service_intro_point_t *ip,
STATIC void run_housekeeping_event(time_t now);
STATIC void rotate_all_descriptors(time_t now);
STATIC void build_all_descriptors(time_t now);
STATIC void update_all_descriptors(time_t now);
STATIC void update_all_descriptors_intro_points(time_t now);
STATIC void run_upload_descriptor_event(time_t now);
STATIC void service_descriptor_free_(hs_service_descriptor_t *desc);

View File

@ -1457,7 +1457,7 @@ test_build_update_descriptors(void *arg)
/* Time to test the update of those descriptors. At first, we have no node
* in the routerlist so this will find NO suitable node for the IPs. */
setup_full_capture_of_logs(LOG_INFO);
update_all_descriptors(now);
update_all_descriptors_intro_points(now);
expect_log_msg_containing("Unable to find a suitable node to be an "
"introduction point for service");
teardown_capture_of_logs();
@ -1508,7 +1508,7 @@ test_build_update_descriptors(void *arg)
/* We expect to pick only one intro point from the node above. */
setup_full_capture_of_logs(LOG_INFO);
update_all_descriptors(now);
update_all_descriptors_intro_points(now);
tor_free(node->ri->onion_curve25519_pkey); /* Avoid memleak. */
tor_free(node->ri->cache_info.signing_key_cert);
tor_free(node->ri->onion_pkey);