From 7170573da7c7b401d95c5f8765102f550726a265 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 7 Apr 2025 01:04:37 +0200 Subject: [PATCH] Cleanup --- RNS/Interfaces/LocalInterface.py | 4 ++-- RNS/Transport.py | 2 +- RNS/Utilities/rncp.py | 2 ++ RNS/Utilities/rnsd.py | 5 +++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/RNS/Interfaces/LocalInterface.py b/RNS/Interfaces/LocalInterface.py index b5f08e23..ead4bd0c 100644 --- a/RNS/Interfaces/LocalInterface.py +++ b/RNS/Interfaces/LocalInterface.py @@ -62,7 +62,7 @@ class LocalClientInterface(Interface): self.HW_MTU = 262144 self.online = False - if RNS.vendor.platformutils.is_linux(): self.socket_path = f"\0rns/{socket_path}" + if socket_path != None and RNS.vendor.platformutils.is_linux(): self.socket_path = f"\0rns/{socket_path}" else: self.socket_path = None self.IN = True @@ -341,7 +341,7 @@ class LocalServerInterface(Interface): self.online = False self.clients = 0 - if RNS.vendor.platformutils.is_linux(): self.socket_path = f"\0rns/{socket_path}" + if socket_path != None and RNS.vendor.platformutils.is_linux(): self.socket_path = f"\0rns/{socket_path}" else: self.socket_path = None self.IN = True diff --git a/RNS/Transport.py b/RNS/Transport.py index 56e03ead..dab27ea7 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -2219,7 +2219,7 @@ class Transport: if cached_packet: # The packet was found in the local cache, # replay it to the Transport instance. - Transport.inbound(packet.raw, packet.receiving_interface) + Transport.inbound(cached_packet.raw, cached_packet.receiving_interface) else: # The packet is not in the local cache, # query the network. diff --git a/RNS/Utilities/rncp.py b/RNS/Utilities/rncp.py index a904de30..9fd67349 100644 --- a/RNS/Utilities/rncp.py +++ b/RNS/Utilities/rncp.py @@ -586,9 +586,11 @@ def fetch(configdir, verbosity = 0, quietness = 0, destination = None, file = No else: print("\n"+str(file)+" fetched from "+RNS.prettyhexrep(destination_hash)) link.teardown() + time.sleep(0.1) RNS.exit(0) link.teardown() + time.sleep(0.1) RNS.exit(0) diff --git a/RNS/Utilities/rnsd.py b/RNS/Utilities/rnsd.py index 12c59fa7..46f837bc 100755 --- a/RNS/Utilities/rnsd.py +++ b/RNS/Utilities/rnsd.py @@ -42,8 +42,9 @@ def program_setup(configdir, verbosity = 0, quietness = 0, service = False): if reticulum.is_connected_to_shared_instance: RNS.log("Started rnsd version {version} connected to another shared local instance, this is probably NOT what you want!".format(version=__version__), RNS.LOG_WARNING) else: - if RNS.Reticulum.get_instance().shared_instance_interface: - RNS.Reticulum.get_instance().shared_instance_interface.server.daemon_threads = True + # TODO: Rethink why this was added + # if RNS.Reticulum.get_instance().shared_instance_interface: + # RNS.Reticulum.get_instance().shared_instance_interface.server.daemon_threads = True RNS.log("Started rnsd version {version}".format(version=__version__), RNS.LOG_NOTICE) while True: