mirror of
https://github.com/markqvist/Reticulum.git
synced 2026-10-26 02:48:57 -04:00
Fixed link stale teardown due to missing keepalive from initiator side when destination continously sends packets
This commit is contained in:
parent
bfade97051
commit
e64d815033
1 changed files with 5 additions and 4 deletions
|
|
@ -746,7 +746,7 @@ class Link:
|
|||
last_inbound = max(max(self.last_inbound, self.last_proof), activated_at)
|
||||
now = time.time()
|
||||
|
||||
if now >= last_inbound + self.keepalive:
|
||||
if now >= last_inbound + self.keepalive or now >= self.last_outbound + self.keepalive:
|
||||
if self.initiator and now >= self.last_keepalive + self.keepalive:
|
||||
self.send_keepalive()
|
||||
|
||||
|
|
@ -1099,9 +1099,10 @@ class Link:
|
|||
|
||||
elif packet.context == RNS.Packet.KEEPALIVE:
|
||||
if not self.initiator and packet.data == bytes([0xFF]):
|
||||
keepalive_packet = RNS.Packet(self, bytes([0xFE]), context=RNS.Packet.KEEPALIVE)
|
||||
keepalive_packet.send()
|
||||
self.had_outbound(is_keepalive = True)
|
||||
if time.time() >= self.last_outbound + self.keepalive:
|
||||
keepalive_packet = RNS.Packet(self, bytes([0xFE]), context=RNS.Packet.KEEPALIVE)
|
||||
keepalive_packet.send()
|
||||
self.had_outbound(is_keepalive = True)
|
||||
|
||||
|
||||
# TODO: find the most efficient way to allow multiple
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue