diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-11-29 10:14:42 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-12-16 11:06:18 -0500 |
commit | 53f248f6c9d71784c271cf14501ec4c28e5e885d (patch) | |
tree | 75b16a87ae378b930796e631bf1f0f01ac8c55e8 /src/or/bridges.c | |
parent | 1d52ac4d3f67a6e3fac3602f87d00c14060068ab (diff) | |
download | tor-53f248f6c9d71784c271cf14501ec4c28e5e885d.tar.gz tor-53f248f6c9d71784c271cf14501ec4c28e5e885d.zip |
Add some needed accessors/inspectors for bridge/guard convergence
Diffstat (limited to 'src/or/bridges.c')
-rw-r--r-- | src/or/bridges.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/or/bridges.c b/src/or/bridges.c index f16acfa28a..8090bae268 100644 --- a/src/or/bridges.c +++ b/src/or/bridges.c @@ -179,7 +179,7 @@ get_configured_bridge_by_orports_digest(const char *digest, * bridge with no known digest whose address matches <b>addr</b>:<b>port</b>, * return that bridge. Else return NULL. If <b>digest</b> is NULL, check for * address/port matches only. */ -static bridge_info_t * +bridge_info_t * get_configured_bridge_by_addr_port_digest(const tor_addr_t *addr, uint16_t port, const char *digest) @@ -416,28 +416,12 @@ bridge_add_from_config(bridge_line_t *bridge_line) smartlist_add(bridge_list, b); } -/** Return true iff <b>routerset</b> contains the bridge <b>bridge</b>. */ -static int -routerset_contains_bridge(const routerset_t *routerset, - const bridge_info_t *bridge) -{ - int result; - extend_info_t *extinfo; - tor_assert(bridge); - if (!routerset) - return 0; - - extinfo = extend_info_new( - NULL, bridge->identity, NULL, NULL, &bridge->addr, bridge->port); - result = routerset_contains_extendinfo(routerset, extinfo); - extend_info_free(extinfo); - return result; -} - /** If <b>digest</b> is one of our known bridges, return it. */ -static bridge_info_t * +bridge_info_t * find_bridge_by_digest(const char *digest) { + if (! bridge_list) + return NULL; SMARTLIST_FOREACH(bridge_list, bridge_info_t *, bridge, { if (tor_memeq(bridge->identity, digest, DIGEST_LEN)) |