-
Notifications
You must be signed in to change notification settings - Fork 225
Default max_buffer_size causes silent failures when streaming #503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This was changed in #319 to avoid DoS. That's fine, but ideally the above code would fail loudly, rather than silently. Maybe I'm using the library wrong, but iterating over a msgpack.Unpacker is recommended in the README without any mention of this: https://github.com/msgpack/msgpack-python#streaming-unpacking |
Thank you for reporting. I agree that Unpacker should raise an error when a message is larger than max_buffer_size. |
Fixes msgpack#503 Raising ValueError matches the behaviour of the pure Python version. I'm not sure that this is the best place to raise this message; it might make more sense in `append_buffer`. It's also conceivable that we want to raise BufferFull instead of ValueError or something.
Thanks! I opened a PR with a potential fix, although not sure it's correct #504 :-) |
Fixes msgpack#503 Raising ValueError matches the behaviour of the pure Python version. I'm not sure that this is the best place to raise this message; it might make more sense when reading headers or in `append_buffer` or something. It's also possible that we want to raise BufferFull instead of ValueError.
Thanks for a useful library!
Consider the following repro:
The text was updated successfully, but these errors were encountered: