Skip to content

Commit

Permalink
Fix the uninitialized buffer during shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
SajjadPourali committed Mar 27, 2024
1 parent f932d57 commit 4deb660
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/stream/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,11 @@ impl AsyncRead for IpStackTcpStream {
}
continue;
}
if let Some(b) = self.tcb.get_unordered_packets() {
if let Some(b) = self
.tcb
.get_unordered_packets()
.filter(|_| matches!(self.shutdown, Shutdown::None))
{
self.tcb.add_ack(b.len() as u32);
buf.put_slice(&b);
self.packet_sender
Expand Down

0 comments on commit 4deb660

Please sign in to comment.