From 456eea9c13accf0b4e858c8e4b4dda10c07f8ce8 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 5 Apr 2025 14:40:00 +0200 Subject: [PATCH] Log instead of raise on outbound on closed link --- RNS/Link.py | 1 - RNS/Packet.py | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/RNS/Link.py b/RNS/Link.py index 13f3334..4ddd67d 100644 --- a/RNS/Link.py +++ b/RNS/Link.py @@ -33,7 +33,6 @@ import math import time import RNS - class LinkCallbacks: def __init__(self): self.link_established = None diff --git a/RNS/Packet.py b/RNS/Packet.py index 7e10a84..bcd5e47 100755 --- a/RNS/Packet.py +++ b/RNS/Packet.py @@ -271,7 +271,11 @@ class Packet: if not self.sent: if self.destination.type == RNS.Destination.LINK: if self.destination.status == RNS.Link.CLOSED: - raise IOError("Attempt to transmit over a closed link") + RNS.log("Attempt to transmit over a closed link, dropping packet", RNS.LOG_DEBUG) + self.sent = False + self.receipt = None + return False + else: self.destination.last_outbound = time.time() self.destination.tx += 1