Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

ssh remote: Reset missed heartbeats on connection activity (#19368)

Thorsten Ballc186e99a3d51
diff --git a/crates/remote/src/ssh_session.rs b/crates/remote/src/ssh_session.rs
index a09faf894cd..6f9df8a4a34 100644
--- a/crates/remote/src/ssh_session.rs
+++ b/crates/remote/src/ssh_session.rs
@@ -832,7 +832,15 @@ impl SshRemoteClient {
log::warn!("ssh heartbeat: connection activity channel has been dropped. stopping.");
return Ok(());
}
+
keepalive_timer.set(cx.background_executor().timer(HEARTBEAT_INTERVAL).fuse());
+
+ if missed_heartbeats != 0 {
+ missed_heartbeats = 0;
+ this.update(&mut cx, |this, mut cx| {
+ this.handle_heartbeat_result(missed_heartbeats, &mut cx)
+ })?;
+ }
}
_ = keepalive_timer => {
log::debug!("Sending heartbeat to server...");
@@ -845,6 +853,7 @@ impl SshRemoteClient {
ping_result
}
};
+
if result.is_err() {
missed_heartbeats += 1;
log::warn!(