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

Flush buffer after writing command #521

Merged
merged 2 commits into from
Nov 23, 2023
Merged

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Nov 23, 2023

Dropping BufWriter flushes the internal buffers, but doesn't flush the inner stream. Calling flush directly does both and also propagates any IO errors back to the caller.

May fix (or may not fix) issues like #450

Copy link
Member

@SergioGasquez SergioGasquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! From the BufWriter docs:

It is critical to call flush before BufWriter is dropped.

Lets see if it fix any issues!

@SergioGasquez
Copy link
Member

SergioGasquez commented Nov 23, 2023

Do you mind adding an entry to the changelog? (I always remember this after approving the changes)

@bugadani
Copy link
Contributor Author

Lets see if it fix any issues!

It fixes mine :)

@SergioGasquez
Copy link
Member

It fixes mine :)

That's already a big thing! Thanks for the PR!

@SergioGasquez SergioGasquez merged commit 0420d79 into esp-rs:main Nov 23, 2023
19 checks passed
@bugadani bugadani deleted the flush branch November 23, 2023 15:53
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