Signed-off-by: David Goulet <dgoulet@torproject.org>
STATIC int
needs_hs_server_circuits(int num_uptime_internal)
{
- return (rend_num_services() &&
+ return ((rend_num_services() || hs_service_get_num_services()) &&
num_uptime_internal < SUFFICIENT_UPTIME_INTERNAL_HS_SERVERS &&
router_have_consensus_path() != CONSENSUS_PATH_UNKNOWN);
}
/* Public API */
/* ========== */
+/* Return the number of service we have configured and usable. */
+unsigned int
+hs_service_get_num_services(void)
+{
+ if (hs_service_map == NULL) {
+ return 0;
+ }
+ return HT_SIZE(hs_service_map);
+}
+
/* Called once an introduction circuit is closed. If the circuit doesn't have
* a v3 identifier, it is ignored. */
void
hs_service_t *hs_service_new(const or_options_t *options);
void hs_service_free(hs_service_t *service);
+unsigned int hs_service_get_num_services(void);
void hs_service_stage_services(const smartlist_t *service_list);
int hs_service_load_all_keys(void);
void hs_service_lists_fnames_for_sandbox(smartlist_t *file_list,