Merge remote-tracking branch 'public/bug3851'

This commit is contained in:
Nick Mathewson 2011-09-07 11:22:24 -04:00
commit 947012e153
3 changed files with 15 additions and 2 deletions

4
changes/bug3851 Normal file
View File

@ -0,0 +1,4 @@
o Minor bugfixes:
- Make 'FetchUselessDescriptors' cause all descriptor types and
all consensus types get fetched. Fixes bug 3851; bugfix on
0.2.3.1-alpha.

View File

@ -698,8 +698,9 @@ we_use_microdescriptors_for_circuits(const or_options_t *options)
int ret = options->UseMicrodescriptors; int ret = options->UseMicrodescriptors;
if (ret == -1) { if (ret == -1) {
/* UseMicrodescriptors is "auto"; we need to decide: */ /* UseMicrodescriptors is "auto"; we need to decide: */
/* So we decide that we'll use microdescriptors iff we are not a server */ /* So we decide that we'll use microdescriptors iff we are not a server,
ret = ! server_mode(options); * and we're not autofetching everything. */
ret = !server_mode(options) && !options->FetchUselessDescriptors;
} }
return ret; return ret;
} }
@ -710,6 +711,8 @@ we_fetch_microdescriptors(const or_options_t *options)
{ {
if (directory_caches_dir_info(options)) if (directory_caches_dir_info(options))
return 1; return 1;
if (options->FetchUselessDescriptors)
return 1;
return we_use_microdescriptors_for_circuits(options); return we_use_microdescriptors_for_circuits(options);
} }
@ -719,6 +722,8 @@ we_fetch_router_descriptors(const or_options_t *options)
{ {
if (directory_caches_dir_info(options)) if (directory_caches_dir_info(options))
return 1; return 1;
if (options->FetchUselessDescriptors)
return 1;
return ! we_use_microdescriptors_for_circuits(options); return ! we_use_microdescriptors_for_circuits(options);
} }

View File

@ -1187,6 +1187,10 @@ we_want_to_fetch_flavor(const or_options_t *options, int flavor)
* it ourselves. */ * it ourselves. */
return 1; return 1;
} }
if (options->FetchUselessDescriptors) {
/* In order to get all descriptors, we need to fetch all consensuses. */
return 1;
}
/* Otherwise, we want the flavor only if we want to use it to build /* Otherwise, we want the flavor only if we want to use it to build
* circuits. */ * circuits. */
return flavor == usable_consensus_flavor(); return flavor == usable_consensus_flavor();