2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-02-19 14:14:26 +00:00

Fix issues in the online debugger

This commit is contained in:
Jarrod Johnson
2024-08-15 16:35:55 -04:00
parent 4945c1f473
commit 511fdfe6c1

View File

@@ -24,6 +24,8 @@ async def interact(cloop, cnn):
newinput = b''
while b'\n' not in newinput:
rcv = await cloop.sock_recv(cnn, 4)
if not rcv:
return
newinput += rcv
somecode += newinput.decode()
if newinput.startswith(b' '):
@@ -48,7 +50,6 @@ async def interact(cloop, cnn):
finally:
sys.stdin, sys.stderr, sys.stdout = saved
cnn.settimeout(0)
print("done")
somecode = ''
prompt = b'>>> '
@@ -56,9 +57,10 @@ async def interact(cloop, cnn):
async def srv_debug(sock):
cloop = asyncio.get_event_loop()
while True:
print("waiting")
cnn, addr = await cloop.sock_accept(sock)
cnn.settimeout(0)
util.spawn(interact(cloop, cnn))
print("next time")
def start_dbgif():