From b0075301236dd27620f2a0bf0d078474b9a4293f Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 14 Jan 2024 01:06:43 +0100 Subject: [PATCH] Adjusted resource timeout calculation --- RNS/Link.py | 2 +- RNS/Resource.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RNS/Link.py b/RNS/Link.py index 6a0ffc2..e7609ff 100644 --- a/RNS/Link.py +++ b/RNS/Link.py @@ -352,7 +352,7 @@ class Link: packed_request = umsgpack.packb(unpacked_request) if timeout == None: - timeout = self.rtt * self.traffic_timeout_factor + RNS.Resource.RESPONSE_MAX_GRACE_TIME/4.0 + timeout = self.rtt * self.traffic_timeout_factor + RNS.Resource.RESPONSE_MAX_GRACE_TIME*1.125 if len(packed_request) <= Link.MDU: request_packet = RNS.Packet(self, packed_request, RNS.Packet.DATA, context = RNS.Packet.REQUEST) diff --git a/RNS/Resource.py b/RNS/Resource.py index b74e9a2..f77c3e5 100644 --- a/RNS/Resource.py +++ b/RNS/Resource.py @@ -468,7 +468,7 @@ class Resource: self.adv_sent = self.last_activity sleep_time = 0.001 except Exception as e: - RNS.log("Could not resend advertisement packet, cancelling resource", RNS.LOG_VERBOSE) + RNS.log("Could not resend advertisement packet, cancelling resource. The contained exception was: "+str(e), RNS.LOG_VERBOSE) self.cancel()