fix: a panic in one session's I/O ends that session cleanly

Every client's reader thread (Telnet/RAW, serial, local shell, IRC, VNC,
RDP) and SSH's channel reader task now run under clients::guarded /
guarded_task. A panic there, such as a decoder bug triggered by a
hostile server, reports 'internal error: …' through the session's
on_error and then closes it, so the tab shows the error (and
auto-reconnect can run) instead of looking connected with nothing
reading. Other sessions were already unaffected since the switch to
parking_lot locks.
This commit is contained in:
Andy Dixon
2026-10-12 17:05:20 +01:00
parent b149fb3b38
commit 02bd237636
7 changed files with 74 additions and 10 deletions
+1 -1
View File
@@ -211,7 +211,7 @@ impl Client {
*self.out.lock() = Some(out_tx);
let client = self.clone();
std::thread::spawn(move || client.io_thread(out_rx));
std::thread::spawn(super::guarded(self.cfg.on_error.clone(), self.cfg.on_close.clone(), move || client.io_thread(out_rx)));
let timeout = self.cfg.connect_timeout;
match ready_rx.recv_timeout(timeout) {