fix forward empty ws messages

This commit is contained in:
Alexander Prinzhorn 2021-07-09 17:42:27 +02:00 committed by Maximilian Hils
parent d93f1b77c1
commit 8c9c6d965b

View File

@ -228,8 +228,8 @@ class Fragmentizer:
def __call__(self, content: bytes) -> Iterator[wsproto.events.Message]: def __call__(self, content: bytes) -> Iterator[wsproto.events.Message]:
if not content: if not content:
return yield self.msg(content, True)
if len(content) == sum(self.fragment_lengths): elif len(content) == sum(self.fragment_lengths):
# message has the same length, we can reuse the same sizes # message has the same length, we can reuse the same sizes
offset = 0 offset = 0
for fl in self.fragment_lengths[:-1]: for fl in self.fragment_lengths[:-1]: