Skip to content

Commit a98e84c

Browse files
committed
revert incorrect keepalive behaviour from 0.51.0
1 parent e8799b4 commit a98e84c

File tree

4 files changed

+1
-5
lines changed

4 files changed

+1
-5
lines changed

russh/src/client/encrypted.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,6 @@ impl Session {
562562
if wants_reply == 1 {
563563
trace!("Received keep alive message: {req:?}",);
564564
self.common.wants_reply = false;
565-
self.common.ever_received_keepalive = true;
566565
push_packet!(enc.write, enc.write.push(msg::REQUEST_SUCCESS));
567566
} else {
568567
warn!("Received keepalive without reply request!");

russh/src/client/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,6 @@ where
889889
alive_timeouts: 0,
890890
received_data: false,
891891
remote_sshid: sshid.into(),
892-
ever_received_keepalive: false,
893892
},
894893
session_receiver,
895894
session_sender,
@@ -1075,7 +1074,7 @@ impl Session {
10751074
reading.set(start_reading(stream_read, buffer, opening_cipher));
10761075
}
10771076
() = &mut keepalive_timer => {
1078-
if self.common.config.keepalive_max != 0 && self.common.alive_timeouts > self.common.config.keepalive_max && self.common.ever_received_keepalive {
1077+
if self.common.config.keepalive_max != 0 && self.common.alive_timeouts > self.common.config.keepalive_max {
10791078
debug!("Timeout, server not responding to keepalives");
10801079
return Err(crate::Error::KeepaliveTimeout.into());
10811080
}

russh/src/server/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,6 @@ async fn read_ssh_id<R: AsyncRead + Unpin>(
992992
alive_timeouts: 0,
993993
received_data: false,
994994
remote_sshid: sshid.into(),
995-
ever_received_keepalive: false,
996995
};
997996
Ok(session)
998997
}

russh/src/session.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ pub(crate) struct CommonSession<Config> {
7272
pub strict_kex: bool,
7373
pub alive_timeouts: usize,
7474
pub received_data: bool,
75-
pub ever_received_keepalive: bool,
7675
}
7776

7877
impl<C> Debug for CommonSession<C> {

0 commit comments

Comments
 (0)