aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendclient.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2016-06-15 09:54:59 -0400
committerDavid Goulet <dgoulet@torproject.org>2016-06-15 10:04:07 -0400
commitc7f1b46a104b18bed017d509a8860e60f7154d67 (patch)
treea90e26bd19fdf850770ab64b50604543e22e6357 /src/or/rendclient.c
parent657067ef9d89c5dd62036e3df78b4bdf62130f42 (diff)
downloadtor-c7f1b46a104b18bed017d509a8860e60f7154d67.tar.gz
tor-c7f1b46a104b18bed017d509a8860e60f7154d67.zip
Perform cache lookup when FetchHidServDescriptors is set
The FetchHidServDescriptors check was placed before the descriptor cache lookup which made the option not working because it was never using the cache in the first place. Fixes #18704 Patched-by: twim Signef-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r--src/or/rendclient.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 7e92dce6d4..64d367354b 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -895,12 +895,6 @@ rend_client_refetch_v2_renddesc(rend_data_t *rend_query)
rend_cache_entry_t *e = NULL;
tor_assert(rend_query);
- /* Are we configured to fetch descriptors? */
- if (!get_options()->FetchHidServDescriptors) {
- log_warn(LD_REND, "We received an onion address for a v2 rendezvous "
- "service descriptor, but are not fetching service descriptors.");
- return;
- }
/* Before fetching, check if we already have a usable descriptor here. */
if (rend_cache_lookup_entry(rend_query->onion_address, -1, &e) == 0 &&
rend_client_any_intro_points_usable(e)) {
@@ -908,6 +902,12 @@ rend_client_refetch_v2_renddesc(rend_data_t *rend_query)
"already have a usable descriptor here. Not fetching.");
return;
}
+ /* Are we configured to fetch descriptors? */
+ if (!get_options()->FetchHidServDescriptors) {
+ log_warn(LD_REND, "We received an onion address for a v2 rendezvous "
+ "service descriptor, but are not fetching service descriptors.");
+ return;
+ }
log_debug(LD_REND, "Fetching v2 rendezvous descriptor for service %s",
safe_str_client(rend_query->onion_address));