diff --git a/Cargo.lock b/Cargo.lock index 3033102..3586ad0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4239,7 +4239,7 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smoltcp" version = "0.12.0" -source = "git+https://github.com/XOR-op/smoltcp.git?branch=rcv-buf-pinned#121f0dc014b24de595a9a0532ac475b31901cf22" +source = "git+https://github.com/XOR-op/smoltcp.git?branch=rcv-buf-pinned#89b7dc984eee4683f85f426df582d783470dcf4b" dependencies = [ "bitflags 1.3.2", "byteorder", diff --git a/boltconn/src/transport/smol.rs b/boltconn/src/transport/smol.rs index f8823ac..8af43dd 100644 --- a/boltconn/src/transport/smol.rs +++ b/boltconn/src/transport/smol.rs @@ -201,7 +201,7 @@ impl TcpConnTask { // Receive data let mut has_activity = false; let mut accum_bytes = 0; - while socket.can_recv() && self.back_tx.capacity() > 0 { + while socket.can_recv() && !self.back_tx.is_closed() && self.back_tx.capacity() > 0 { let mut buf = BytesMut::with_capacity(MAX_PKT_SIZE); if let Ok(size) = socket.recv_slice(unsafe { mut_buf(&mut buf) }) { unsafe { buf.advance_mut(size) };