Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive committed Mar 11, 2024
1 parent 8cf1295 commit 6dcbfbf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/stream/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ impl AsyncRead for IpStackTcpStream {
}
let min = cmp::min(self.tcb.get_available_read_buffer_size() as u16, u16::MAX);
self.tcb.change_recv_window(min);
use Poll::Ready;
if matches!(Pin::new(&mut self.tcb.timeout).poll(cx), Ready(_)) {
if matches!(Pin::new(&mut self.tcb.timeout).poll(cx), Poll::Ready(_)) {
#[cfg(feature = "log")]
trace!("timeout reached for {:?}", self.dst_addr);
let flags = tcp_flags::RST | tcp_flags::ACK;
Expand Down Expand Up @@ -279,7 +278,7 @@ impl AsyncRead for IpStackTcpStream {
Some(self.create_rev_packet(0, DROP_TTL, None, Vec::new())?);
self.tcb.change_state(TcpState::Closed);
self.shutdown.ready();
return Ready(Err(Error::from(ErrorKind::ConnectionReset)));
return Poll::Ready(Err(Error::from(ErrorKind::ConnectionReset)));
}
if matches!(
self.tcb.check_pkt_type(&t, &p.payload),
Expand Down

0 comments on commit 6dcbfbf

Please sign in to comment.