Skip to content

Commit

Permalink
fix: smoltcp replace tcp recv buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
XOR-op committed Feb 20, 2025
1 parent bb6d3fe commit 8f75d43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion boltconn/src/transport/smol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) };
Expand Down

0 comments on commit 8f75d43

Please sign in to comment.