mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-18 06:18:08 +00:00
Fix non responsive console for Docker VMs. Fixes https://github.com/GNS3/gns3-gui/issues/2645
This commit is contained in:
parent
56412b35e0
commit
bec2270334
@ -643,7 +643,7 @@ class DockerVM(BaseNode):
|
|||||||
|
|
||||||
async def drain(self):
|
async def drain(self):
|
||||||
if not self.ws.closed:
|
if not self.ws.closed:
|
||||||
self.ws.send_bytes(self._data)
|
await self.ws.send_bytes(self._data)
|
||||||
self._data = b""
|
self._data = b""
|
||||||
|
|
||||||
output_stream = asyncio.StreamReader()
|
output_stream = asyncio.StreamReader()
|
||||||
@ -671,15 +671,15 @@ class DockerVM(BaseNode):
|
|||||||
|
|
||||||
while True:
|
while True:
|
||||||
msg = await ws.receive()
|
msg = await ws.receive()
|
||||||
if msg.tp == aiohttp.WSMsgType.text:
|
if msg.type == aiohttp.WSMsgType.text:
|
||||||
out.feed_data(msg.data.encode())
|
out.feed_data(msg.data.encode())
|
||||||
elif msg.tp == aiohttp.WSMsgType.BINARY:
|
elif msg.type == aiohttp.WSMsgType.BINARY:
|
||||||
out.feed_data(msg.data)
|
out.feed_data(msg.data)
|
||||||
elif msg.tp == aiohttp.WSMsgType.ERROR:
|
elif msg.type == aiohttp.WSMsgType.ERROR:
|
||||||
log.critical("Docker WebSocket Error: {}".format(msg.data))
|
log.critical("Docker WebSocket Error: {}".format(ws.exception()))
|
||||||
else:
|
else:
|
||||||
out.feed_eof()
|
out.feed_eof()
|
||||||
ws.close()
|
await ws.close()
|
||||||
break
|
break
|
||||||
await self.stop()
|
await self.stop()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user