mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-26 07:20:18 +00:00
Fixed race condition for link initiators on timed out link establishment
This commit is contained in:
parent
420d58527d
commit
049733c4b6
@ -277,8 +277,8 @@ class Link:
|
|||||||
signature = packet.data[:RNS.Identity.SIGLENGTH//8]
|
signature = packet.data[:RNS.Identity.SIGLENGTH//8]
|
||||||
|
|
||||||
if self.destination.identity.validate(signature, signed_data):
|
if self.destination.identity.validate(signature, signed_data):
|
||||||
if self.status != Link.PENDING:
|
if self.status != Link.HANDSHAKE:
|
||||||
raise IOError("Invalid link state for proof validation")
|
raise IOError("Invalid link state for proof validation: "+str(self.status))
|
||||||
|
|
||||||
self.rtt = time.time() - self.request_time
|
self.rtt = time.time() - self.request_time
|
||||||
self.attached_interface = packet.receiving_interface
|
self.attached_interface = packet.receiving_interface
|
||||||
|
@ -1741,8 +1741,8 @@ class Transport:
|
|||||||
def activate_link(link):
|
def activate_link(link):
|
||||||
RNS.log("Activating link "+str(link), RNS.LOG_EXTREME)
|
RNS.log("Activating link "+str(link), RNS.LOG_EXTREME)
|
||||||
if link in Transport.pending_links:
|
if link in Transport.pending_links:
|
||||||
if link.status != Link.PENDING:
|
if link.status != RNS.Link.ACTIVE:
|
||||||
raise IOError("Invalid link state for link activation")
|
raise IOError("Invalid link state for link activation: "+str(link.status))
|
||||||
Transport.pending_links.remove(link)
|
Transport.pending_links.remove(link)
|
||||||
Transport.active_links.append(link)
|
Transport.active_links.append(link)
|
||||||
link.status = RNS.Link.ACTIVE
|
link.status = RNS.Link.ACTIVE
|
||||||
|
Loading…
Reference in New Issue
Block a user