3939//! let client_key = russh_keys::key::KeyPair::generate_ed25519().unwrap();
4040//! let client_pubkey = Arc::new(client_key.clone_public_key().unwrap());
4141//! let mut config = russh::server::Config::default();
42- //! config.connection_timeout = Some(std::time::Duration::from_secs(3));
42+ //! config.inactivity_timeout = Some(std::time::Duration::from_secs(3));
4343//! config.auth_rejection_time = std::time::Duration::from_secs(3);
4444//! config.keys.push(russh_keys::key::KeyPair::generate_ed25519().unwrap());
4545//! let config = Arc::new(config);
@@ -167,7 +167,7 @@ pub struct Config {
167167 /// Maximal number of allowed authentication attempts.
168168 pub max_auth_attempts : usize ,
169169 /// Time after which the connection is garbage-collected.
170- pub connection_timeout : Option < std:: time:: Duration > ,
170+ pub inactivity_timeout : Option < std:: time:: Duration > ,
171171}
172172
173173impl Default for Config {
@@ -189,7 +189,7 @@ impl Default for Config {
189189 limits : Limits :: default ( ) ,
190190 preferred : Default :: default ( ) ,
191191 max_auth_attempts : 10 ,
192- connection_timeout : Some ( std:: time:: Duration :: from_secs ( 600 ) ) ,
192+ inactivity_timeout : Some ( std:: time:: Duration :: from_secs ( 600 ) ) ,
193193 }
194194 }
195195}
@@ -724,7 +724,7 @@ async fn read_ssh_id<R: AsyncRead + Unpin>(
724724 config : Arc < Config > ,
725725 read : & mut SshRead < R > ,
726726) -> Result < CommonSession < Arc < Config > > , Error > {
727- let sshid = if let Some ( t) = config. connection_timeout {
727+ let sshid = if let Some ( t) = config. inactivity_timeout {
728728 tokio:: time:: timeout ( t, read. read_ssh_id ( ) ) . await ??
729729 } else {
730730 read. read_ssh_id ( ) . await ?
0 commit comments