Merge pull request #3136 from trepidacious/read_ready_smoltcp_fix

Add check for closed connection to `read_ready()`
This commit is contained in:
Dario Nieuwenhuis 2024-06-30 21:05:52 +00:00 committed by GitHub
commit e0c0a618bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -587,7 +587,7 @@ mod embedded_io_impls {
impl<'d> embedded_io_async::ReadReady for TcpSocket<'d> {
fn read_ready(&mut self) -> Result<bool, Self::Error> {
Ok(self.io.with(|s, _| s.can_recv()))
Ok(self.io.with(|s, _| s.can_recv() || !s.may_recv()))
}
}