Adjusted StreamDataMessage overhead calculation

This commit is contained in:
Mark Qvist 2023-03-04 19:06:47 +01:00
parent 37b2d8a6ec
commit 80f3bfaece

View File

@ -65,7 +65,7 @@ class StreamDataMessage(MessageBase):
_link_sized_bytes = ("\0"*RNS.Link.MDU).encode("utf-8") _link_sized_bytes = ("\0"*RNS.Link.MDU).encode("utf-8")
StreamDataMessage.OVERHEAD = len(StreamDataMessage(stream_id=StreamDataMessage.STREAM_ID_MAX, StreamDataMessage.OVERHEAD = len(StreamDataMessage(stream_id=StreamDataMessage.STREAM_ID_MAX,
data=_link_sized_bytes, 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 StreamDataMessage.MAX_DATA_LEN = RNS.Link.MDU - StreamDataMessage.OVERHEAD
_link_sized_bytes = None _link_sized_bytes = None