aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-11-15 19:38:19 -0500
committerNick Mathewson <nickm@torproject.org>2010-11-15 19:43:53 -0500
commit45b500d5a60ca6c43e5a545b9e15e203be1feeac (patch)
treeeb471e036fee17063fe3be57d6157959f088bf4f /src
parentaccc51b68c3ec898488a170973bf306d91ebe691 (diff)
downloadtor-45b500d5a60ca6c43e5a545b9e15e203be1feeac.tar.gz
tor-45b500d5a60ca6c43e5a545b9e15e203be1feeac.zip
Clean up my 1776 fix a bit
Sebastian notes (and I think correctly) that one of our ||s should have been an &&, which simplifies a boolean expression to decide whether to replace bridges. I'm also refactoring out the negation at the start of the expression, to make it more readable.
Diffstat (limited to 'src')
-rw-r--r--src/or/routerlist.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 0e9265fe4f..670574a9d3 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -3238,8 +3238,12 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
const int was_bridge = old_router &&
old_router->purpose == ROUTER_PURPOSE_BRIDGE;
- if (! (routerinfo_is_a_configured_bridge(router) &&
- (router->purpose == ROUTER_PURPOSE_BRIDGE || !was_bridge))) {
+ if (routerinfo_is_a_configured_bridge(router) &&
+ router->purpose == ROUTER_PURPOSE_BRIDGE &&
+ !was_bridge) {
+ log_info(LD_DIR, "Replacing non-bridge descriptor with bridge "
+ "descriptor for router '%s'", router->nickname);
+ } else {
log_info(LD_DIR,
"Dropping descriptor that we already have for router '%s'",
router->nickname);