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

fix: BufReader should not panic when used after cancellation #226

Closed

Conversation

losfair
Copy link

@losfair losfair commented Jan 21, 2024

If a BufReader::fill_buf() call is cancelled when the internal buffer is held by .read(), re-allocate the buffer when used in the future.

@CLAassistant
Copy link

CLAassistant commented Jan 21, 2024

CLA assistant check
All committers have signed the CLA.

@losfair
Copy link
Author

losfair commented Jan 22, 2024

Closing this - simply re-allocating the buffer is incorrect because cancellation is asynchronous and this can result in lost data.

The error message could be improved though...

@losfair losfair closed this Jan 22, 2024
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.

2 participants