From 731c516a3ae6f57e5d9a63bb9744f7d266b63a09 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Tue, 26 Nov 2024 17:01:49 -0500 Subject: [PATCH] Ensure Session is made in new thread --- lib/nntp/tiny/server.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/nntp/tiny/server.py b/lib/nntp/tiny/server.py index 90d9e53..a2a2995 100644 --- a/lib/nntp/tiny/server.py +++ b/lib/nntp/tiny/server.py @@ -34,8 +34,11 @@ class Server(): while True: sock, addr = listener.accept() - session = Session(self, sock) - thread = threading.Thread(target=session.handle) + def spawn(): + session = Session(self, sock) + session.handle() + + thread = threading.Thread(target=spawn) thread.start() listener.close()