aboutsummaryrefslogtreecommitdiff
path: root/src/or/microdesc.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-08-29 11:18:06 -0400
committerNick Mathewson <nickm@torproject.org>2011-08-29 11:18:06 -0400
commit3b02a959b32c1664a2a62b36badda343cca1bc6a (patch)
treec43f0aa329e957f451cca6ce16cc33e0e7592cde /src/or/microdesc.c
parent38881173188209db0bb9dd40bacc48aa1883f5e4 (diff)
downloadtor-3b02a959b32c1664a2a62b36badda343cca1bc6a.tar.gz
tor-3b02a959b32c1664a2a62b36badda343cca1bc6a.zip
Make FetchUselessDescriptors fetch all desc types
Previously, if you were set up to use microdescriptors, and you weren't a cache, you'd never fetch router descriptors (except for bridges). Now FetchUselessDescriptors causes descriptors and mirodescs to get cached. Also, FetchUselessDescriptors changes the behavior of "UseMicrodescriptors auto" to be off, since there's no point in saying "UseMicrodescriptors 1" when you have full descriptors too. Fix for bug 3851; bugfix on 0.2.3.1-alpha.
Diffstat (limited to 'src/or/microdesc.c')
-rw-r--r--src/or/microdesc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/microdesc.c b/src/or/microdesc.c
index 627fad58e1..510b2f40f7 100644
--- a/src/or/microdesc.c
+++ b/src/or/microdesc.c
@@ -698,8 +698,9 @@ we_use_microdescriptors_for_circuits(const or_options_t *options)
int ret = options->UseMicrodescriptors;
if (ret == -1) {
/* UseMicrodescriptors is "auto"; we need to decide: */
- /* So we decide that we'll use microdescriptors iff we are not a server */
- ret = ! server_mode(options);
+ /* So we decide that we'll use microdescriptors iff we are not a server,
+ * and we're not autofetching everything. */
+ ret = !server_mode(options) && !options->FetchUselessDescriptors;
}
return ret;
}
@@ -710,6 +711,8 @@ we_fetch_microdescriptors(const or_options_t *options)
{
if (directory_caches_dir_info(options))
return 1;
+ if (options->FetchUselessDescriptors)
+ return 1;
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))
return 1;
+ if (options->FetchUselessDescriptors)
+ return 1;
return ! we_use_microdescriptors_for_circuits(options);
}