Improved exception handling and telnet client disconnect

This commit is contained in:
Cristi authored and grossmj committed 2026-04-05 13:29:35 +08:00
1 parent 7684ce60ce
commit c739a16d70
2 files changed
+5 -1

No files matched your search

@@ -251,8 +251,12 @@ class AsyncioTelnetServer:
async def _invoke_window_size_changed(self, connection, columns, rows):
try:
await connection.window_size_changed(columns, rows)
except asyncio.CancelledError:
raise
except (ConnectionError, OSError):
connection.close()
except Exception:
log.exception("Unhandled exception in window_size_changed callback for %r", connection)
async def _run_client_session(self, network_reader, network_writer):
self._set_socket_options(network_writer)