bugfix
This commit is contained in:
parent
36f809a6c3
commit
d1eaafa42b
@ -24,7 +24,7 @@ class XtermProcessor(PythonScriptProcessor):
|
|||||||
async def ws_2_process(self, ws):
|
async def ws_2_process(self, ws):
|
||||||
async for msg in ws:
|
async for msg in ws:
|
||||||
if msg.type == aiohttp.WSMsgType.TEXT:
|
if msg.type == aiohttp.WSMsgType.TEXT:
|
||||||
# debug(f'recv from ws:{msg}.................')
|
debug(f'recv from ws:{msg}.................')
|
||||||
data = DictObject(**json.loads(msg.data))
|
data = DictObject(**json.loads(msg.data))
|
||||||
if data.type == 'input':
|
if data.type == 'input':
|
||||||
self.p_obj.stdin.write(data.data)
|
self.p_obj.stdin.write(data.data)
|
||||||
@ -49,6 +49,7 @@ class XtermProcessor(PythonScriptProcessor):
|
|||||||
try:
|
try:
|
||||||
while self.running:
|
while self.running:
|
||||||
x = await self.p_obj.stdout.read(1024)
|
x = await self.p_obj.stdout.read(1024)
|
||||||
|
debug(f'{x=}')
|
||||||
await self.ws_send_data(ws, x)
|
await self.ws_send_data(ws, x)
|
||||||
await asyncio.sleep(0)
|
await asyncio.sleep(0)
|
||||||
finally:
|
finally:
|
||||||
@ -84,6 +85,7 @@ class XtermProcessor(PythonScriptProcessor):
|
|||||||
r1 = self.ws_2_process(ws)
|
r1 = self.ws_2_process(ws)
|
||||||
r2 = self.process_2_ws(ws)
|
r2 = self.process_2_ws(ws)
|
||||||
await asyncio.gather(r1,r2)
|
await asyncio.gather(r1,r2)
|
||||||
|
debug(f'run_xterm() ended')
|
||||||
|
|
||||||
async def ws_send_heartbeat(self, ws):
|
async def ws_send_heartbeat(self, ws):
|
||||||
dic = {
|
dic = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user