]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Convert authdir_mode_handles_descs() to alternative wrappers
authorhuyvq <huyvq.c633@gmail.com>
Fri, 2 Jun 2017 16:32:41 +0000 (23:32 +0700)
committerNick Mathewson <nickm@torproject.org>
Wed, 21 Jun 2017 17:49:17 +0000 (13:49 -0400)
-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).

src/or/router.c
src/or/routerlist.c

index a264af155193cc5136b16626ab5ebd5b8e5780f1..e12f13865ddaf182ca999a1a002ecdf9140bc089 100644 (file)
@@ -1065,7 +1065,7 @@ init_keys(void)
   /* 4. Build our router descriptor. */
   /* Must be called after keys are initialized. */
   mydesc = router_get_my_descriptor();
-  if (authdir_mode_handles_descs(options, ROUTER_PURPOSE_GENERAL)) {
+  if (authdir_mode_v3(options)) {
     const char *m = NULL;
     routerinfo_t *ri;
     /* 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)
     return authdir_mode_v3(options);
   else if (purpose == ROUTER_PURPOSE_BRIDGE)
-    return (options->BridgeAuthoritativeDir);
+    return authdir_mode_bridge(options);
   else
     return 0;
 }
index 0e45f63f702c20efb828ec8943f689565b351267..da072beb599bce4962d764ffab743543cca82a61 100644 (file)
@@ -5164,7 +5164,7 @@ update_consensus_router_descriptor_downloads(time_t now, int is_vote,
       smartlist_add(downloadable, rs->descriptor_digest);
   } SMARTLIST_FOREACH_END(rsp);
 
-  if (!authdir_mode_handles_descs(options, ROUTER_PURPOSE_GENERAL)
+  if (!authdir_mode_v3(options)
       && smartlist_len(no_longer_old)) {
     routerlist_t *rl = router_get_routerlist();
     log_info(LD_DIR, "%d router descriptors listed in consensus are "