diff options
| author | trepidacious <[email protected]> | 2024-06-30 17:47:04 +0100 |
|---|---|---|
| committer | trepidacious <[email protected]> | 2024-06-30 17:47:04 +0100 |
| commit | c3be54f96b2a7e9039f4d12bbd97217dd65969d7 (patch) | |
| tree | 9143a886bc7d6455d6b01e02f33fdc48f4034633 /embassy-net | |
| parent | bd0243d12f621b977ce767c11325acb95c7b658a (diff) | |
Add check for closed connection to `read_ready()`
Diffstat (limited to 'embassy-net')
| -rw-r--r-- | embassy-net/src/tcp.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/embassy-net/src/tcp.rs b/embassy-net/src/tcp.rs index 906102bbf..4d6dc92de 100644 --- a/embassy-net/src/tcp.rs +++ b/embassy-net/src/tcp.rs | |||
| @@ -587,7 +587,7 @@ mod embedded_io_impls { | |||
| 587 | 587 | ||
| 588 | impl<'d> embedded_io_async::ReadReady for TcpSocket<'d> { | 588 | impl<'d> embedded_io_async::ReadReady for TcpSocket<'d> { |
| 589 | fn read_ready(&mut self) -> Result<bool, Self::Error> { | 589 | fn read_ready(&mut self) -> Result<bool, Self::Error> { |
| 590 | Ok(self.io.with(|s, _| s.can_recv())) | 590 | Ok(self.io.with(|s, _| s.can_recv() || !s.may_recv())) |
| 591 | } | 591 | } |
| 592 | } | 592 | } |
| 593 | 593 | ||
