summaryrefslogtreecommitdiff
path: root/src/or/entrynodes.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2017-10-03 14:38:53 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2017-10-03 14:41:20 +0300
commit5352785d0caec23f753ae7fcab4449b03f5643b8 (patch)
treeabb5e756a3a1b77af2869b1faff18570216b6426 /src/or/entrynodes.c
parentf2231306ba58cc5d9a5addb41eb7f287e3802746 (diff)
downloadtor-5352785d0caec23f753ae7fcab4449b03f5643b8.tar.gz
tor-5352785d0caec23f753ae7fcab4449b03f5643b8.zip
entrynodes: Error msg for missing guard descs is now more informative.
Diffstat (limited to 'src/or/entrynodes.c')
-rw-r--r--src/or/entrynodes.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 1e96fc7f54..c71a93beae 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -3442,9 +3442,13 @@ guards_retry_optimistic(const or_options_t *options)
/**
* Check if we are missing any crucial dirinfo for the guard subsystem to
* work. Return NULL if everything went well, otherwise return a newly
- * allocated string with an informative error message. */
+ * allocated string with an informative error message. In the latter case, use
+ * the genreal descriptor information <b>using_mds</b>, <b>num_present</b> and
+ * <b>num_usable</b> to improve the error message. */
char *
-guard_selection_get_dir_info_status_str(guard_selection_t *gs)
+guard_selection_get_dir_info_status_str(guard_selection_t *gs,
+ int using_mds,
+ int num_present, int num_usable)
{
if (!gs->primary_guards_up_to_date)
entry_guards_update_primary(gs);
@@ -3478,8 +3482,9 @@ guard_selection_get_dir_info_status_str(guard_selection_t *gs)
/* otherwise return a helpful error string */
tor_asprintf(&ret_str, "We're missing descriptors for %d/%d of our "
- "primary entry guards",
- n_missing_descriptors, num_primary_to_check);
+ "primary entry guards (total %sdescriptors: %d/%d).",
+ n_missing_descriptors, num_primary_to_check,
+ using_mds?"micro":"", num_present, num_usable);
return ret_str;
}
@@ -3487,10 +3492,12 @@ guard_selection_get_dir_info_status_str(guard_selection_t *gs)
/** As guard_selection_have_enough_dir_info_to_build_circuits, but uses
* the default guard selection. */
char *
-entry_guards_get_dir_info_status_str(void)
+entry_guards_get_dir_info_status_str(int using_mds,
+ int num_present, int num_usable)
{
- return guard_selection_get_dir_info_status_str(
- get_guard_selection_info());
+ return guard_selection_get_dir_info_status_str(get_guard_selection_info(),
+ using_mds,
+ num_present, num_usable);
}
/** Free one guard selection context */