| @@ -55,6 +55,7 @@ pub struct SshConnectionOptions { · 54 unmodified lines |
| 55 | pub password: Option<String>, | 55 | pub password: Option<String>, |
| 56 | pub args: Option<Vec<String>>, | 56 | pub args: Option<Vec<String>>, |
| 57 | pub port_forwards: Option<Vec<SshPortForwardOption>>, | 57 | pub port_forwards: Option<Vec<SshPortForwardOption>>, |
| | 58 | pub connection_timeout: Option<u16>, |
| 58 | | 59 | |
| 59 | pub nickname: Option<String>, | 60 | pub nickname: Option<String>, |
| 60 | pub upload_binary_over_ssh: bool, | 61 | pub upload_binary_over_ssh: bool, |
| @@ -71,6 +72,7 @@ impl From<settings::SshConnection> for SshConnectionOptions { · 10 unmodified lines |
| 71 | nickname: val.nickname, | 72 | nickname: val.nickname, |
| 72 | upload_binary_over_ssh: val.upload_binary_over_ssh.unwrap_or_default(), | 73 | upload_binary_over_ssh: val.upload_binary_over_ssh.unwrap_or_default(), |
| 73 | port_forwards: val.port_forwards, | 74 | port_forwards: val.port_forwards, |
| | 75 | connection_timeout: val.connection_timeout, |
| 74 | } | 76 | } |
| 75 | } | 77 | } |
| 76 | } | 78 | } |
| @@ -670,7 +672,12 @@ impl SshRemoteConnection { · 593 unmodified lines |
| 670 | | 672 | |
| 671 | delegate.set_status(Some("Downloading remote development server on host"), cx); | 673 | delegate.set_status(Some("Downloading remote development server on host"), cx); |
| 672 | | 674 | |
| 673 | const CONNECT_TIMEOUT_SECS: &str = "10"; | 675 | let connection_timeout = self |
| | 676 | .socket |
| | 677 | .connection_options |
| | 678 | .connection_timeout |
| | 679 | .unwrap_or(10) |
| | 680 | .to_string(); |
| 674 | | 681 | |
| 675 | match self | 682 | match self |
| 676 | .socket | 683 | .socket |
| @@ -681,7 +688,7 @@ impl SshRemoteConnection { · 4 unmodified lines |
| 681 | "-f", | 688 | "-f", |
| 682 | "-L", | 689 | "-L", |
| 683 | "--connect-timeout", | 690 | "--connect-timeout", |
| 684 | CONNECT_TIMEOUT_SECS, | 691 | &connection_timeout, |
| 685 | url, | 692 | url, |
| 686 | "-o", | 693 | "-o", |
| 687 | &tmp_path_gz.display(self.path_style()), | 694 | &tmp_path_gz.display(self.path_style()), |
| @@ -709,7 +716,7 @@ impl SshRemoteConnection { · 21 unmodified lines |
| 709 | "wget", | 716 | "wget", |
| 710 | &[ | 717 | &[ |
| 711 | "--connect-timeout", | 718 | "--connect-timeout", |
| 712 | CONNECT_TIMEOUT_SECS, | 719 | &connection_timeout, |
| 713 | "--tries", | 720 | "--tries", |
| 714 | "1", | 721 | "1", |
| 715 | url, | 722 | url, |
| @@ -1226,6 +1233,7 @@ impl SshConnectionOptions { · 510 unmodified lines |
| 1226 | password: None, | 1233 | password: None, |
| 1227 | nickname: None, | 1234 | nickname: None, |
| 1228 | upload_binary_over_ssh: false, | 1235 | upload_binary_over_ssh: false, |
| | 1236 | connection_timeout: None, |
| 1229 | }) | 1237 | }) |
| 1230 | } | 1238 | } |
| 1231 | | 1239 | |
| @@ -1252,6 +1260,10 @@ impl SshConnectionOptions { · 20 unmodified lines |
| 1252 | pub fn additional_args(&self) -> Vec<String> { | 1260 | pub fn additional_args(&self) -> Vec<String> { |
| 1253 | let mut args = self.additional_args_for_scp(); | 1261 | let mut args = self.additional_args_for_scp(); |
| 1254 | | 1262 | |
| | 1263 | if let Some(timeout) = self.connection_timeout { |
| | 1264 | args.extend(["-o".to_string(), format!("ConnectTimeout={}", timeout)]); |
| | 1265 | } |
| | 1266 | |
| 1255 | if let Some(forwards) = &self.port_forwards { | 1267 | if let Some(forwards) = &self.port_forwards { |
| 1256 | args.extend(forwards.iter().map(|pf| { | 1268 | args.extend(forwards.iter().map(|pf| { |
| 1257 | let local_host = match &pf.local_host { | 1269 | let local_host = match &pf.local_host { |