Optimizations

This commit is contained in:
Flowseal
2026-10-06 23:21:03 +03:00
parent 3c54c54d36
commit 3fa281625f
3 changed files with 29 additions and 12 deletions
+5 -2
View File
@@ -72,11 +72,14 @@ class MsgSplitter:
if packet_len is None:
break
if packet_len <= 0:
parts.append(bytes(self._cipher_buf[offset:]))
parts.append(bytes(self._cipher_buf) if offset == 0 else bytes(self._cipher_buf[offset:]))
offset = buf_len
self._disabled = True
break
parts.append(bytes(self._cipher_buf[offset:offset + packet_len]))
if offset == 0 and packet_len == buf_len:
parts.append(bytes(self._cipher_buf))
else:
parts.append(bytes(self._cipher_buf[offset:offset + packet_len]))
offset += packet_len
if offset: