mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-16 16:54:51 +02:00
Fix broken embedded console for Ethernet switch. Fixes #1574
This commit is contained in:
parent
8cd66cfc02
commit
cc1980ac1c
@ -198,8 +198,8 @@ class UnstoppableEventLoop(EventLoop):
|
|||||||
|
|
||||||
|
|
||||||
class ShellConnection(TelnetConnection):
|
class ShellConnection(TelnetConnection):
|
||||||
def __init__(self, reader, writer, shell, loop):
|
def __init__(self, reader, writer, shell, window_size_changed_callback, loop):
|
||||||
super(ShellConnection, self).__init__(reader, writer)
|
super(ShellConnection, self).__init__(reader, writer, window_size_changed_callback)
|
||||||
self._shell = shell
|
self._shell = shell
|
||||||
self._loop = loop
|
self._loop = loop
|
||||||
self._cli = None
|
self._cli = None
|
||||||
@ -239,9 +239,12 @@ class ShellConnection(TelnetConnection):
|
|||||||
def disconnected(self):
|
def disconnected(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@asyncio.coroutine
|
||||||
def window_size_changed(self, columns, rows):
|
def window_size_changed(self, columns, rows):
|
||||||
self._size = Size(rows=rows, columns=columns)
|
self._size = Size(rows=rows, columns=columns)
|
||||||
self._cb.terminal_size_changed()
|
self._cb.terminal_size_changed()
|
||||||
|
if self._window_size_changed_callback:
|
||||||
|
yield from self._window_size_changed_callback(columns, rows)
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def feed(self, data):
|
def feed(self, data):
|
||||||
@ -291,8 +294,8 @@ def create_telnet_shell(shell, loop=None):
|
|||||||
if loop is None:
|
if loop is None:
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
|
|
||||||
def factory(reader, writer):
|
def factory(reader, writer, window_size_changed_callback):
|
||||||
return ShellConnection(reader, writer, shell, loop)
|
return ShellConnection(reader, writer, shell, window_size_changed_callback, loop)
|
||||||
|
|
||||||
return AsyncioTelnetServer(binary=True, echo=True, naws=True, connection_factory=factory)
|
return AsyncioTelnetServer(binary=True, echo=True, naws=True, connection_factory=factory)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user