From 32e4c262eff437eb42610bb5ed9409a3979ce49e Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 3 Sep 2021 15:47:42 +0200 Subject: [PATCH] Improved link timeout handling. --- RNS/Link.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/RNS/Link.py b/RNS/Link.py index 06088c9..f564fd5 100644 --- a/RNS/Link.py +++ b/RNS/Link.py @@ -47,7 +47,7 @@ class Link: # This value is set at a reasonable # level for a 1 Kb/s channel. - ESTABLISHMENT_TIMEOUT_PER_HOP = 20 + ESTABLISHMENT_TIMEOUT_PER_HOP = 5 """ Default timeout for link establishment in seconds per hop to destination. """ @@ -446,7 +446,11 @@ class Link: next_check = self.request_time + self.establishment_timeout sleep_time = next_check - time.time() if time.time() >= self.request_time + self.establishment_timeout: - RNS.log("Timeout waiting for RTT packet from link initiator", RNS.LOG_DEBUG) + if self.initiator: + RNS.log("Timeout waiting link request proof", RNS.LOG_DEBUG) + else: + RNS.log("Timeout waiting for RTT packet from link initiator", RNS.LOG_DEBUG) + self.status = Link.CLOSED self.teardown_reason = Link.TIMEOUT self.link_closed()