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

Don't panic on full bluetooth receive queue #170

Closed
undefinedvalue opened this issue May 8, 2023 · 1 comment · Fixed by #186
Closed

Don't panic on full bluetooth receive queue #170

undefinedvalue opened this issue May 8, 2023 · 1 comment · Fixed by #186
Labels
enhancement New feature or request

Comments

@undefinedvalue
Copy link

https://github.com/esp-rs/esp-wifi/blob/c446177984b82b5e1658d6b24318e7214460ded8/esp-wifi/src/ble/btdm.rs#L94

The above line calls unwrap(), which causes a panic if enqueue was called while the queue was full. The queue just overwrites the oldest item and returns that item as the Err. This should mean a packet is dropped, it shouldn't mean the whole program panics in an unrecoverable way.

@bjoernQ
Copy link
Contributor

bjoernQ commented May 9, 2023

Good point! It's definitely better to drop a packet instead of panicking

@bjoernQ bjoernQ added the enhancement New feature or request label May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants