Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions async-ssh2-lite/src/session_stream/impl_tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ impl AsyncSessionStream for TcpStream {
}

match sess.block_directions() {
BlockDirections::None => {
unreachable!("")
}
BlockDirections::None => continue,
BlockDirections::Inbound => {
assert!(expected_block_directions.is_readable());

Expand Down Expand Up @@ -77,26 +75,20 @@ impl AsyncSessionStream for TcpStream {
}

match sess.block_directions() {
BlockDirections::None => {
unreachable!("")
}
BlockDirections::Inbound => {
assert!(expected_block_directions.is_readable());

BlockDirections::Inbound if expected_block_directions.is_readable() => {
ready!(self.poll_read_ready(cx))?;
}
BlockDirections::Outbound => {
assert!(expected_block_directions.is_writable());

BlockDirections::Outbound if expected_block_directions.is_writable() => {
ready!(self.poll_write_ready(cx))?;
}
BlockDirections::Both => {
assert!(expected_block_directions.is_readable());
assert!(expected_block_directions.is_writable());

BlockDirections::Both
if expected_block_directions.is_readable()
&& expected_block_directions.is_writable() =>
{
ready!(self.poll_write_ready(cx))?;
ready!(self.poll_read_ready(cx))?;
}
_ => return Poll::Pending,
}

if let Some(dur) = sleep_dur {
Expand Down