aboutsummaryrefslogtreecommitdiff
path: root/src/or/bridges.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-12-07 12:36:13 -0500
committerNick Mathewson <nickm@torproject.org>2016-12-16 11:06:22 -0500
commit68679504323b0a676a446b8fb34b976c9dc66b4f (patch)
tree89a6a9621fae80e4c41114aee2d0f12aed437dcb /src/or/bridges.c
parent2b4bfe62ee74b927d65923f5d07fe04f51f8779a (diff)
downloadtor-68679504323b0a676a446b8fb34b976c9dc66b4f.tar.gz
tor-68679504323b0a676a446b8fb34b976c9dc66b4f.zip
Wrap all of the legacy guard code, and its users, in #ifdefs
This will make it easier to see what we remove down the line.
Diffstat (limited to 'src/or/bridges.c')
-rw-r--r--src/or/bridges.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/bridges.c b/src/or/bridges.c
index c480e3fb7b..4058979bfb 100644
--- a/src/or/bridges.c
+++ b/src/or/bridges.c
@@ -743,7 +743,11 @@ learned_bridge_descriptor(routerinfo_t *ri, int from_cache)
(int) bridge->port);
}
if (get_options()->UseDeprecatedGuardAlgorithm) {
+#ifdef ENABLE_LEGACY_GUARD_ALGORITHM
add_bridge_as_entry_guard(get_guard_selection_info(), node);
+#else
+ tor_assert_nonfatal_unreached();
+#endif
} else {
entry_guard_learned_bridge_identity(&bridge->addrport_configured,
(const uint8_t*)ri->cache_info.identity_digest);
@@ -754,8 +758,12 @@ learned_bridge_descriptor(routerinfo_t *ri, int from_cache)
/* set entry->made_contact so if it goes down we don't drop it from
* our entry node list */
if (get_options()->UseDeprecatedGuardAlgorithm) {
+#ifdef ENABLE_LEGACY_GUARD_ALGORITHM
entry_guard_register_connect_status(ri->cache_info.identity_digest,
1, 0, now);
+#else
+ tor_assert_nonfatal_unreached();
+#endif
}
if (first) {
routerlist_retry_directory_downloads(now);