From 5230a7ddc37e2b0ff2fefc19f003affb6d154fe4 Mon Sep 17 00:00:00 2001 From: computergeek125 Date: Fri, 19 Nov 2021 18:31:33 -0600 Subject: [PATCH] fix I/O thread read, fixed thread ident/pid --- app/classes/shared/cmd.py | 2 +- app/classes/shared/server.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/classes/shared/cmd.py b/app/classes/shared/cmd.py index 064bb7ef..dfce718a 100644 --- a/app/classes/shared/cmd.py +++ b/app/classes/shared/cmd.py @@ -71,7 +71,7 @@ class MainPrompt(cmd.Cmd, object): def do_threads(self, line): for thread in threading.enumerate(): - print(f'Name: {thread.name} PID: {thread.ident}') + print(f'Name: {thread.name} IDENT: {thread.ident}') def universal_exit(self): logger.info("Stopping all server daemons / threads") diff --git a/app/classes/shared/server.py b/app/classes/shared/server.py index 1b4ad0c0..379bde10 100644 --- a/app/classes/shared/server.py +++ b/app/classes/shared/server.py @@ -71,7 +71,7 @@ class ServerOutBuf: # TODO: we may want to benchmark reading in blocks and userspace processing it later, reads are kind of expensive as a syscall self.process_byte(char) else: - flush = self.proc.stdout.read().decode('utf-8') + flush = self.proc.stdout.readall().decode('utf-8') for char in flush: self.process_byte(char) break