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

ChunkedBodyReader: do not continue reading if remaining is zero #57

Closed
wants to merge 3 commits into from
Closed

ChunkedBodyReader: do not continue reading if remaining is zero #57

wants to merge 3 commits into from

Conversation

vhdirk
Copy link

@vhdirk vhdirk commented Nov 4, 2023

read would hang if max_len is zero

@rmja
Copy link
Member

rmja commented Nov 4, 2023

@vhdirk @bugadani I added a test for this and a missing read of the final termination \r\n when an empty chunk is detected.

@bugadani
Copy link
Contributor

bugadani commented Nov 4, 2023

Good find and I think the added check is fine, but I think the underlying bug is drogue-iot/embedded-tls#130

@rmja
Copy link
Member

rmja commented Nov 4, 2023

@vhdirk Sorry for polluting the PR with my commits. I though I was adding tests showing your issue, but it was actually finding a different issue. A read with an empty buffer is well defined and should simply return Ok(0). The underlying issue to the problem that you see is, as @bugadani pointed out, in embedded-tls. The issue is fixed over there, and the fix in reqwless that I found in my commits to this PR are now over in #58 .

@rmja rmja closed this Nov 4, 2023
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.

3 participants