2 Commits

Author SHA1 Message Date
78bc46c56b Close any remaining connections once the tui exits
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 6m1s
2025-04-20 21:21:07 +02:00
3e726c713f Fixed stats
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 5m45s
2025-04-20 20:46:31 +02:00
2 changed files with 21 additions and 1 deletions

View File

@@ -39,7 +39,7 @@ impl Stats {
} }
pub fn set_failed(&self, failed: bool) { pub fn set_failed(&self, failed: bool) {
self.failed.store(failed, Ordering::Relaxed); self.failed.fetch_and(failed, Ordering::Relaxed);
} }
pub fn rx(&self) -> Unit { pub fn rx(&self) -> Unit {

View File

@@ -330,6 +330,26 @@ impl russh::server::Handler for Handler {
Ok(session.channel_success(channel)?) Ok(session.channel_success(channel)?)
} }
async fn channel_close(
&mut self,
channel: ChannelId,
session: &mut Session,
) -> Result<(), Self::Error> {
if let Some(pty_channel) = self.pty_channel
&& pty_channel == channel
{
debug!("Pty channel closed");
session.disconnect(
russh::Disconnect::ByApplication,
"Remaining active connections have been closed",
"EN",
)?;
}
Ok(())
}
async fn tcpip_forward( async fn tcpip_forward(
&mut self, &mut self,
address: &str, address: &str,