mandrewcito / signalrcore

SignalR Core python client
https://mandrewcito.github.io/signalrcore/
MIT License
115 stars 53 forks source link

Fix MessagePack message size determination #111

Open stephtr opened 3 months ago

stephtr commented 3 months ago

The algorithm for determining the size of MessagePack messages was wrong. The size is not encoded in the msgpack format, but distributed over the first few bytes (until the first one with the 0x80 bit set). For messages smaller than 128 bytes, this doesn't make a difference, but for larger messages, the function failed. I took the implementation from the official JS client and ported it to python.