aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/or/main.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/or/main.c b/src/or/main.c
index a49ad5d2d..4914bd262 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -625,13 +625,16 @@ run_connection_housekeeping(int i, time_t now)
conn->address, conn->port, conn->s,
(int)(now - conn->timestamp_created));
conn->is_obsolete = 1;
- } else if (connection_or_get_by_identity_digest(conn->identity_digest) !=
- conn) {
- info(LD_OR,
- "Marking duplicate conn to %s:%d obsolete (fd %d, %d secs old).",
- conn->address, conn->port, conn->s,
- (int)(now - conn->timestamp_created));
- conn->is_obsolete = 1;
+ } else {
+ connection_t *best =
+ connection_or_get_by_identity_digest(conn->identity_digest);
+ if (best && best != conn) {
+ info(LD_OR,
+ "Marking duplicate conn to %s:%d obsolete (fd %d, %d secs old).",
+ conn->address, conn->port, conn->s,
+ (int)(now - conn->timestamp_created));
+ conn->is_obsolete = 1;
+ }
}
}