Address multiple issues with Buffer and Channel

- StreamDataMessage now packed by struct rather than umsgpack for a more predictable size
- Added protected variable on LocalInterface to allow tests to simulate a low bandwidth connection
- Retry timer now has exponential backoff and a more sane starting value
- Link proves packet _before_ sending contents to Channel; this should help prevent spurious retries especially on half-duplex links
- Prevent Transport packet filter from filtering out duplicate packets for Channel; handle duplicates in Channel to ensure the packet is reproven (in case the original proof packet was lost)
- Fix up other tests broken by these changes
This commit is contained in:
Aaron Heise 2023-03-04 23:37:58 -06:00
parent d8f3ad8d3f
commit 6d9d410a70
No known key found for this signature in database
GPG key ID: 6BA54088C41DE8BF
7 changed files with 186 additions and 45 deletions

View file

@ -809,9 +809,9 @@ class Link:
if not self._channel:
RNS.log(f"Channel data received without open channel", RNS.LOG_DEBUG)
else:
packet.prove()
plaintext = self.decrypt(packet.data)
self._channel._receive(plaintext)
packet.prove()
elif packet.packet_type == RNS.Packet.PROOF:
if packet.context == RNS.Packet.RESOURCE_PRF: