Fixed resource transfers hanging for a long time over slow links if proof packet is lost

This commit is contained in:
Mark Qvist 2024-10-10 17:06:43 +02:00
parent d63bbcdc0a
commit 6521f839cd
2 changed files with 17 additions and 1 deletions

View file

@ -1738,7 +1738,16 @@ class Transport:
if link.link_id == packet.destination_hash:
if link.attached_interface == packet.receiving_interface:
packet.link = link
link.receive(packet)
if packet.context == RNS.Packet.CACHE_REQUEST:
cached_packet = Transport.get_cached_packet(packet.data)
if cached_packet != None:
cached_packet.unpack()
RNS.Packet(destination=link, data=cached_packet.data,
packet_type=cached_packet.packet_type, context=cached_packet.context).send()
Transport.jobs_locked = False
else:
link.receive(packet)
else:
# In the strange and rare case that an interface
# is partly malfunctioning, and a link-associated