diff options
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r-- | src/or/rendclient.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c index fb50e8dc00..5b18a519b0 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -80,8 +80,8 @@ rend_client_send_introduction(origin_circuit_t *introcirc, goto err; } - /* first 20 bytes of payload are the hash of bob's pk */ - if (entry->parsed->version == 0) { /* unversioned descriptor */ + /* first 20 bytes of payload are the hash of Bob's pk */ + if (entry->parsed->version == 0) { /* un-versioned descriptor */ intro_key = entry->parsed->pk; } else { /* versioned descriptor */ intro_key = NULL; @@ -482,8 +482,9 @@ rend_client_refetch_v2_renddesc(const rend_data_t *rend_query) { char descriptor_id[DIGEST_LEN]; int replicas_left_to_try[REND_NUMBER_OF_NON_CONSECUTIVE_REPLICAS]; - int i, tries_left; + int i, tries_left, r; rend_cache_entry_t *e = NULL; + time_t now = time(NULL); tor_assert(rend_query); /* Are we configured to fetch descriptors? */ if (!get_options()->FetchHidServDescriptors) { @@ -492,9 +493,11 @@ rend_client_refetch_v2_renddesc(const rend_data_t *rend_query) return; } /* Before fetching, check if we already have the descriptor here. */ - if (rend_cache_lookup_entry(rend_query->onion_address, -1, &e) > 0) { + r = rend_cache_lookup_entry(rend_query->onion_address, -1, &e); + if (r > 0 && now - e->received < NUM_SECONDS_BEFORE_HS_REFETCH) { log_info(LD_REND, "We would fetch a v2 rendezvous descriptor, but we " - "already have that descriptor here. Not fetching."); + "already have a fresh copy of that descriptor here. " + "Not fetching."); return; } log_debug(LD_REND, "Fetching v2 rendezvous descriptor for service %s", |