Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

fix: apply message size limit before decoding message #231

Merged
merged 2 commits into from
Nov 24, 2022

Conversation

achingbrain
Copy link
Member

If we apply the message size limit after decoding the message it's too late as we've already processed the bad message.

Instead, if the buffer full of unprocessed messages grows to be larger than the max message size (e.g. we have not received a complete message under the size limit), throw an error which will cause the stream to be reset.

If we apply the message size limit after decoding the message it's
too late as we've already processed the bad message.

Instead, if the buffer full of unprocessed messages grows to be
large than the max message size (e.g. we have not recieved a complete
message under the size limit), throw an error which will cause the
stream to be reset.
@mpetrunic
Copy link
Member

@achingbrain Is something missing from this PR? I only see you've added constant

@achingbrain
Copy link
Member Author

Hmm, weird - should be good now.

@mpetrunic mpetrunic merged commit 279ad47 into master Nov 24, 2022
@mpetrunic mpetrunic deleted the fix/apply-size-limit-during-decode branch November 24, 2022 09:48
github-actions bot pushed a commit that referenced this pull request Nov 24, 2022
## [7.0.5](v7.0.4...v7.0.5) (2022-11-24)

### Bug Fixes

* apply message size limit before decoding message ([#231](#231)) ([279ad47](279ad47))
* limit unprocessed message queue size separately to message size ([#234](#234)) ([2297856](2297856))
* yield single buffers ([#233](#233)) ([31d3938](31d3938))
@github-actions
Copy link

🎉 This PR is included in version 7.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mpetrunic mpetrunic linked an issue Nov 24, 2022 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

restrictSize performance issue
2 participants