aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@torproject.org>2023-10-25 00:55:43 +0000
committerMike Perry <mikeperry-git@torproject.org>2023-11-01 19:57:08 +0000
commit6bfadc7a5db2d3d6ca1449a43edc711814934ca9 (patch)
tree5b0b785d2d72498547e9212c4273ec4e8c2c805a
parentd7f14a54fbf520ffc56d162426f649ecde12e287 (diff)
downloadtor-6bfadc7a5db2d3d6ca1449a43edc711814934ca9.tar.gz
tor-6bfadc7a5db2d3d6ca1449a43edc711814934ca9.zip
Bug 40876: Extra logging
-rw-r--r--src/feature/client/entrynodes.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/feature/client/entrynodes.c b/src/feature/client/entrynodes.c
index 45fd3a4d9a..7c469ea84a 100644
--- a/src/feature/client/entrynodes.c
+++ b/src/feature/client/entrynodes.c
@@ -2193,6 +2193,10 @@ select_primary_guard_for_circuit(guard_selection_t *gs,
* one from the list. */
if (num_entry_guards_considered >= num_entry_guards_to_consider) {
break;
+ }
+ } else {
+ log_info(LD_GUARD, "Guard %s is not reachable",
+ entry_guard_describe(guard));
}
} SMARTLIST_FOREACH_END(guard);
@@ -2202,6 +2206,10 @@ select_primary_guard_for_circuit(guard_selection_t *gs,
"Selected primary guard %s for circuit from a list size of %d.",
entry_guard_describe(chosen_guard),
smartlist_len(usable_primary_guards));
+ /* Describe each guard in the list: */
+ SMARTLIST_FOREACH_BEGIN(usable_primary_guards, entry_guard_t *, guard) {
+ log_info(LD_GUARD, " %s", entry_guard_describe(guard));
+ } SMARTLIST_FOREACH_END(guard);
smartlist_free(usable_primary_guards);
}
@@ -2307,16 +2315,22 @@ select_entry_guard_for_circuit(guard_selection_t *gs,
/* "If any entry in PRIMARY_GUARDS has {is_reachable} status of
<maybe> or <yes>, return the first such guard." */
chosen_guard = select_primary_guard_for_circuit(gs, usage, rst, state_out);
- if (chosen_guard)
+ if (chosen_guard) {
+ log_info(LD_GUARD, "Selected primary guard %s for circuit.",
+ entry_guard_describe(chosen_guard));
return chosen_guard;
+ }
/* "Otherwise, if the ordered intersection of {CONFIRMED_GUARDS}
and {USABLE_FILTERED_GUARDS} is nonempty, return the first
entry in that intersection that has {is_pending} set to
false." */
chosen_guard = select_confirmed_guard_for_circuit(gs, usage, rst, state_out);
- if (chosen_guard)
+ if (chosen_guard) {
+ log_info(LD_GUARD, "Selected confirmed guard %s for circuit.",
+ entry_guard_describe(chosen_guard));
return chosen_guard;
+ }
/* "Otherwise, if there is no such entry, select a member
* {USABLE_FILTERED_GUARDS} following the sample ordering" */
@@ -2329,6 +2343,8 @@ select_entry_guard_for_circuit(guard_selection_t *gs,
return NULL;
}
+ log_info(LD_GUARD, "Selected filtered guard %s for circuit.",
+ entry_guard_describe(chosen_guard));
return chosen_guard;
}