From 4fd3d26714aec6b7b14f261d2434572376b86cb3 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 19 Aug 2021 17:05:07 +0200 Subject: [PATCH] Fixed UDP broadcast echo packets not being filtered. --- Examples/Filetransfer.py | 7 ++++++- RNS/Transport.py | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Examples/Filetransfer.py b/Examples/Filetransfer.py index 092cb9a..ca94046 100644 --- a/Examples/Filetransfer.py +++ b/Examples/Filetransfer.py @@ -135,7 +135,12 @@ def client_disconnected(link): def client_request(message, packet): global serve_path - filename = message.decode("utf-8") + + try: + filename = message.decode("utf-8") + except Exception as e: + filename = None + if filename in list_files(): try: # If we have the requested file, we'll diff --git a/RNS/Transport.py b/RNS/Transport.py index d748faf..bff20c6 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -397,8 +397,9 @@ class Transport: if sent: packet.sent = True packet.sent_at = time.time() + Transport.packet_hashlist.append(packet.packet_hash) - # Don't generate receipt if it has been explicitly disabled + # Don't generate receipt if it has been explicitly disabled if (packet.create_receipt == True and # Only generate receipts for DATA packets packet.packet_type == RNS.Packet.DATA and