mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-05-06 08:25:57 -04:00
Added resource HMU/part request hash filter. Fixes #7.
This commit is contained in:
parent
0c96508cca
commit
40f7a6d359
3 changed files with 7 additions and 2 deletions
|
@ -651,7 +651,11 @@ class Link:
|
|||
resource_hash = plaintext[1:RNS.Identity.HASHLENGTH//8+1]
|
||||
for resource in self.outgoing_resources:
|
||||
if resource.hash == resource_hash:
|
||||
resource.request(plaintext)
|
||||
# We need to check that this request has not been
|
||||
# received before in order to avoid sequencing errors.
|
||||
if not packet.packet_hash in resource.req_hashlist:
|
||||
resource.req_hashlist.append(packet.packet_hash)
|
||||
resource.request(plaintext)
|
||||
|
||||
elif packet.context == RNS.Packet.RESOURCE_HMU:
|
||||
plaintext = self.decrypt(packet.data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue