From 80f3bfaeceb106a27e21d8d95ff6437c8393a803 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 4 Mar 2023 19:06:47 +0100 Subject: [PATCH] Adjusted StreamDataMessage overhead calculation --- RNS/Buffer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RNS/Buffer.py b/RNS/Buffer.py index 75989c5..55f1d98 100644 --- a/RNS/Buffer.py +++ b/RNS/Buffer.py @@ -65,7 +65,7 @@ class StreamDataMessage(MessageBase): _link_sized_bytes = ("\0"*RNS.Link.MDU).encode("utf-8") StreamDataMessage.OVERHEAD = len(StreamDataMessage(stream_id=StreamDataMessage.STREAM_ID_MAX, data=_link_sized_bytes, - eof=True).pack()) - len(_link_sized_bytes) - 6 # 6 is envelope overhead + eof=True).pack()) - len(_link_sized_bytes) + 4 # TODO: Calculation was off by 10 bytes, why? StreamDataMessage.MAX_DATA_LEN = RNS.Link.MDU - StreamDataMessage.OVERHEAD _link_sized_bytes = None