|
@@ -141,8 +141,7 @@ entry_guard_set_status(entry_guard_t *e, const node_t *node,
|
|
|
}
|
|
|
|
|
|
if (node) {
|
|
|
- int is_dir = node_is_dir(node) && node->rs &&
|
|
|
- node->rs->version_supports_microdesc_cache;
|
|
|
+ int is_dir = node_is_dir(node);
|
|
|
if (options->UseBridges && node_is_a_configured_bridge(node))
|
|
|
is_dir = 1;
|
|
|
if (e->is_dir_cache != is_dir) {
|
|
@@ -398,10 +397,7 @@ add_an_entry_guard(const node_t *chosen, int reset_status, int prepend,
|
|
|
entry->bad_since = 0;
|
|
|
entry->can_retry = 1;
|
|
|
}
|
|
|
- entry->is_dir_cache = node->rs &&
|
|
|
- node->rs->version_supports_microdesc_cache;
|
|
|
- if (get_options()->UseBridges && node_is_a_configured_bridge(node))
|
|
|
- entry->is_dir_cache = 1;
|
|
|
+ entry->is_dir_cache = node_is_dir(node);
|
|
|
return NULL;
|
|
|
}
|
|
|
} else if (!for_directory) {
|
|
@@ -432,8 +428,7 @@ add_an_entry_guard(const node_t *chosen, int reset_status, int prepend,
|
|
|
node_describe(node));
|
|
|
strlcpy(entry->nickname, node_get_nickname(node), sizeof(entry->nickname));
|
|
|
memcpy(entry->identity, node->identity, DIGEST_LEN);
|
|
|
- entry->is_dir_cache = node_is_dir(node) && node->rs &&
|
|
|
- node->rs->version_supports_microdesc_cache;
|
|
|
+ entry->is_dir_cache = node_is_dir(node);
|
|
|
if (get_options()->UseBridges && node_is_a_configured_bridge(node))
|
|
|
entry->is_dir_cache = 1;
|
|
|
|
|
@@ -973,39 +968,6 @@ entry_list_is_constrained(const or_options_t *options)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- * microdescriptors. */
|
|
|
-static int
|
|
|
-node_understands_microdescriptors(const node_t *node)
|
|
|
-{
|
|
|
- tor_assert(node);
|
|
|
- if (node->rs && node->rs->version_supports_microdesc_cache)
|
|
|
- return 1;
|
|
|
- if (node->ri && tor_version_supports_microdescriptors(node->ri->platform))
|
|
|
- return 1;
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
- * of type <b>dirinfo</b>. Always returns true if <b>dirinfo</b> is
|
|
|
- * NO_DIRINFO (zero). */
|
|
|
-static int
|
|
|
-node_can_handle_dirinfo(const node_t *node, dirinfo_type_t dirinfo)
|
|
|
-{
|
|
|
-
|
|
|
- yet, since we only choose directory guards that can support microdescs,
|
|
|
- routerinfos, and networkstatuses, AND we don't use directory guards if
|
|
|
- we're configured to do direct downloads of anything else. The only case
|
|
|
- where we might have a guard that doesn't know about a type of directory
|
|
|
- information is when we're retrieving directory information from a
|
|
|
- bridge. */
|
|
|
-
|
|
|
- if ((dirinfo & MICRODESC_DIRINFO) &&
|
|
|
- !node_understands_microdescriptors(node))
|
|
|
- return 0;
|
|
|
- return 1;
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
* <b>state</b> is non-NULL, this is for a specific circuit --
|
|
|
* make sure not to pick this circuit's exit or any node in the
|
|
@@ -1092,9 +1054,6 @@ populate_live_entry_guards(smartlist_t *live_entry_guards,
|
|
|
continue;
|
|
|
if (smartlist_contains(exit_family, node))
|
|
|
continue;
|
|
|
- if (dirinfo_type != NO_DIRINFO &&
|
|
|
- !node_can_handle_dirinfo(node, dirinfo_type))
|
|
|
- continue;
|
|
|
smartlist_add(live_entry_guards, (void*)node);
|
|
|
if (!entry->made_contact) {
|
|
|
|
|
@@ -2468,11 +2427,9 @@ any_bridge_supports_microdescriptors(void)
|
|
|
SMARTLIST_FOREACH_BEGIN(entry_guards, entry_guard_t *, e) {
|
|
|
node = node_get_by_id(e->identity);
|
|
|
if (node && node->is_running &&
|
|
|
- node_is_bridge(node) && node_is_a_configured_bridge(node) &&
|
|
|
- node_understands_microdescriptors(node)) {
|
|
|
+ node_is_bridge(node) && node_is_a_configured_bridge(node)) {
|
|
|
|
|
|
- * it to know that it will be able to answer our microdescriptor
|
|
|
- * questions. */
|
|
|
+ * it to know that it will be able to answer our questions. */
|
|
|
return 1;
|
|
|
}
|
|
|
} SMARTLIST_FOREACH_END(e);
|