* 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);
"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);
}
/* "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" */
return NULL;
}
+ log_info(LD_GUARD, "Selected filtered guard %s for circuit.",
+ entry_guard_describe(chosen_guard));
return chosen_guard;
}