Convert authdir_mode_handles_descs() to alternative wrappers

-authdir_mode_handles_descs(options, ROUTER_PURPOSE_BRIDGE) to authdir_mode_bridge(options).

- authdir_mode_handles_descs(options, ROUTER_PURPOSE_GENERAL) to authdir_mode_v3(options).
This commit is contained in:
huyvq 2017-06-02 23:32:41 +07:00 committed by Nick Mathewson
parent d92b999757
commit 18cd1993ca
2 changed files with 3 additions and 3 deletions

View File

@ -1065,7 +1065,7 @@ init_keys(void)
/* 4. Build our router descriptor. */ /* 4. Build our router descriptor. */
/* Must be called after keys are initialized. */ /* Must be called after keys are initialized. */
mydesc = router_get_my_descriptor(); mydesc = router_get_my_descriptor();
if (authdir_mode_handles_descs(options, ROUTER_PURPOSE_GENERAL)) { if (authdir_mode_v3(options)) {
const char *m = NULL; const char *m = NULL;
routerinfo_t *ri; routerinfo_t *ri;
/* We need to add our own fingerprint so it gets recognized. */ /* We need to add our own fingerprint so it gets recognized. */
@ -1615,7 +1615,7 @@ authdir_mode_handles_descs(const or_options_t *options, int purpose)
else if (purpose == ROUTER_PURPOSE_GENERAL) else if (purpose == ROUTER_PURPOSE_GENERAL)
return authdir_mode_v3(options); return authdir_mode_v3(options);
else if (purpose == ROUTER_PURPOSE_BRIDGE) else if (purpose == ROUTER_PURPOSE_BRIDGE)
return (options->BridgeAuthoritativeDir); return authdir_mode_bridge(options);
else else
return 0; return 0;
} }

View File

@ -5164,7 +5164,7 @@ update_consensus_router_descriptor_downloads(time_t now, int is_vote,
smartlist_add(downloadable, rs->descriptor_digest); smartlist_add(downloadable, rs->descriptor_digest);
} SMARTLIST_FOREACH_END(rsp); } SMARTLIST_FOREACH_END(rsp);
if (!authdir_mode_handles_descs(options, ROUTER_PURPOSE_GENERAL) if (!authdir_mode_v3(options)
&& smartlist_len(no_longer_old)) { && smartlist_len(no_longer_old)) {
routerlist_t *rl = router_get_routerlist(); routerlist_t *rl = router_get_routerlist();
log_info(LD_DIR, "%d router descriptors listed in consensus are " log_info(LD_DIR, "%d router descriptors listed in consensus are "