From bf726ed2c7332d7d1fbad0e70e82fe0507f43316 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 21 Sep 2023 14:12:14 +0200 Subject: [PATCH] Fixed missing timeout check in rncp --- RNS/Utilities/rncp.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/RNS/Utilities/rncp.py b/RNS/Utilities/rncp.py index cede2b8..d883dd5 100644 --- a/RNS/Utilities/rncp.py +++ b/RNS/Utilities/rncp.py @@ -579,11 +579,17 @@ def send(configdir, verbosity = 0, quietness = 0, destination = None, file = Non sys.stdout.flush() i = (i+1)%len(syms) - if not RNS.Transport.has_path(destination_hash): + if time.time() > estab_timeout: if silent: - print("Could not establish link with "+RNS.prettyhexrep(destination_hash)) + print("Link establishment with "+RNS.prettyhexrep(destination_hash)+" timed out") else: - print("\r \rCould not establish link with "+RNS.prettyhexrep(destination_hash)) + print("\r \rLink establishment with "+RNS.prettyhexrep(destination_hash)+" timed out") + exit(1) + elif not RNS.Transport.has_path(destination_hash): + if silent: + print("No path found to "+RNS.prettyhexrep(destination_hash)) + else: + print("\r \rNo path found to "+RNS.prettyhexrep(destination_hash)) exit(1) else: if silent: