mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-05-02 22:54:54 -04:00
Optimised link establishment
This commit is contained in:
parent
cf9934810b
commit
d68cfaa8f7
13 changed files with 42 additions and 38 deletions
|
@ -209,14 +209,15 @@ class Destination:
|
|||
self.proof_strategy = proof_strategy
|
||||
|
||||
def receive(self, packet):
|
||||
plaintext = self.decrypt(packet.data)
|
||||
if plaintext != None:
|
||||
if packet.packet_type == RNS.Packet.LINKREQUEST:
|
||||
self.incoming_link_request(plaintext, packet)
|
||||
|
||||
if packet.packet_type == RNS.Packet.DATA:
|
||||
if self.callbacks.packet != None:
|
||||
self.callbacks.packet(plaintext, packet)
|
||||
if packet.packet_type == RNS.Packet.LINKREQUEST:
|
||||
plaintext = packet.data
|
||||
self.incoming_link_request(plaintext, packet)
|
||||
else:
|
||||
plaintext = self.decrypt(packet.data)
|
||||
if plaintext != None:
|
||||
if packet.packet_type == RNS.Packet.DATA:
|
||||
if self.callbacks.packet != None:
|
||||
self.callbacks.packet(plaintext, packet)
|
||||
|
||||
def incoming_link_request(self, data, packet):
|
||||
link = RNS.Link.validate_request(self, data, packet)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue