From c2b78400f257fc9602261a6ed344b7b6fedfcbac Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 16 Feb 2016 17:26:53 +0100 Subject: [PATCH] Fix closing a docker console jump to 100% of CPU usage Fix #427 --- gns3server/utils/asyncio/telnet_server.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gns3server/utils/asyncio/telnet_server.py b/gns3server/utils/asyncio/telnet_server.py index 839e69f5..1f7fabe2 100644 --- a/gns3server/utils/asyncio/telnet_server.py +++ b/gns3server/utils/asyncio/telnet_server.py @@ -127,6 +127,11 @@ class AsyncioTelnetServer: data = coro.result() if coro == network_read: network_read = asyncio.async(network_reader.read(READ_SIZE)) + + # Remote console is closed + if len(data) == 0: + raise ConnectionResetError() + if IAC in data: data = yield from self._IAC_parser(data, network_reader, network_writer) if self._writer: