summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-07-01 09:35:27 +1000
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-07-01 09:35:27 +1000
commit596ccbf8396b10fb404594c201bd04ef135b330f (patch)
tree1f261ba7ecd3d0a333d4a646225d1e1ef2f6f0e0
parent64ee7bcd0c8e154269145b626a7cd56b9d6264a1 (diff)
downloadtor-596ccbf8396b10fb404594c201bd04ef135b330f.tar.gz
tor-596ccbf8396b10fb404594c201bd04ef135b330f.zip
Refactor authority_certs_fetch_missing to call get_options once
-rw-r--r--src/or/routerlist.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index d8319afe19..296dbd8b0e 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -865,12 +865,13 @@ authority_certs_fetch_missing(networkstatus_t *status, time_t now,
smartlist_t *missing_cert_digests, *missing_id_digests;
char *resource = NULL;
cert_list_t *cl;
- const int cache = directory_caches_unknown_auth_certs(get_options());
+ const or_options_t *options = get_options();
+ const int cache = directory_caches_unknown_auth_certs(options);
fp_pair_t *fp_tmp = NULL;
char id_digest_str[2*DIGEST_LEN+1];
char sk_digest_str[2*DIGEST_LEN+1];
- if (should_delay_dir_fetches(get_options(), NULL))
+ if (should_delay_dir_fetches(options, NULL))
return;
pending_cert = fp_pair_map_new();
@@ -911,7 +912,7 @@ authority_certs_fetch_missing(networkstatus_t *status, time_t now,
} SMARTLIST_FOREACH_END(cert);
if (!found &&
download_status_is_ready(&(cl->dl_status_by_id), now,
- get_options()->TestingCertMaxDownloadTries) &&
+ options->TestingCertMaxDownloadTries) &&
!digestmap_get(pending_id, ds->v3_identity_digest)) {
log_info(LD_DIR,
"No current certificate known for authority %s "
@@ -973,7 +974,7 @@ authority_certs_fetch_missing(networkstatus_t *status, time_t now,
}
if (download_status_is_ready_by_sk_in_cl(
cl, sig->signing_key_digest,
- now, get_options()->TestingCertMaxDownloadTries) &&
+ now, options->TestingCertMaxDownloadTries) &&
!fp_pair_map_get_by_digests(pending_cert,
voter->identity_digest,
sig->signing_key_digest)) {
@@ -1075,7 +1076,7 @@ authority_certs_fetch_missing(networkstatus_t *status, time_t now,
* directory */
if (rs) {
/* Certificate fetches are one-hop, unless AllDirActionsPrivate is 1 */
- int get_via_tor = get_options()->AllDirActionsPrivate;
+ int get_via_tor = options->AllDirActionsPrivate;
const dir_indirection_t indirection = get_via_tor ? DIRIND_ANONYMOUS
: DIRIND_ONEHOP;
directory_initiate_command_routerstatus(rs,
@@ -1136,7 +1137,7 @@ authority_certs_fetch_missing(networkstatus_t *status, time_t now,
* directory */
if (rs) {
/* Certificate fetches are one-hop, unless AllDirActionsPrivate is 1 */
- int get_via_tor = get_options()->AllDirActionsPrivate;
+ int get_via_tor = options->AllDirActionsPrivate;
const dir_indirection_t indirection = get_via_tor ? DIRIND_ANONYMOUS
: DIRIND_ONEHOP;
directory_initiate_command_routerstatus(rs,