Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(body): set an internal max to reserve in
to_bytes
Previously, `to_bytes` would reserve extra space if after two chunks, there was more remaining. It used to reserve however much space the peer advertized. This changes now only reserves up to ~16kb. This way, a slow message with a big body doesn't reserve so much memory, until the data has actually been received. The existing warning to check for a length before calling the function is still the best approach.
- Loading branch information