Skip to content
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

transport: fix infinate loop on chunkReader.Close() #71

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

nemith
Copy link
Owner

@nemith nemith commented Jan 25, 2024

If the stream is closed before reaching the end-of-frame marker (n##n) and there is more chunks left then there is a condition where the chunkLeft is never updated resulting in a loop in Close().

This probably needs a deeper rethink but at very least if we reach the end-of-frame marker we should update the r.chunkLeft before returning the error to clean up and also make sure to record the bytes discarded.

Thanks to @nights99 for reporting this

Fixes: #69

@nemith nemith merged commit cc556ee into main Feb 8, 2024
6 checks passed
@nemith nemith deleted the nemith/chunkCloseLoop branch February 8, 2024 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chunk reader gets stuck in a loop at the end of a frame
1 participant