mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-14 07:03:44 +01:00
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.
This commit is contained in:
parent
accc51b68c
commit
45b500d5a6
@ -3238,8 +3238,12 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
|
|||||||
const int was_bridge = old_router &&
|
const int was_bridge = old_router &&
|
||||||
old_router->purpose == ROUTER_PURPOSE_BRIDGE;
|
old_router->purpose == ROUTER_PURPOSE_BRIDGE;
|
||||||
|
|
||||||
if (! (routerinfo_is_a_configured_bridge(router) &&
|
if (routerinfo_is_a_configured_bridge(router) &&
|
||||||
(router->purpose == ROUTER_PURPOSE_BRIDGE || !was_bridge))) {
|
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,
|
log_info(LD_DIR,
|
||||||
"Dropping descriptor that we already have for router '%s'",
|
"Dropping descriptor that we already have for router '%s'",
|
||||||
router->nickname);
|
router->nickname);
|
||||||
|
Loading…
Reference in New Issue
Block a user