diff --git a/Lib/SocketServer.py b/Lib/SocketServer.py index 00064ba8968..5128e17548f 100644 --- a/Lib/SocketServer.py +++ b/Lib/SocketServer.py @@ -448,10 +448,15 @@ class ForkingMixIn: class ThreadingMixIn: """Mix-in class to handle each request in a new thread.""" + def process_request_thread(self, request, client_address): + """Same as in BaseServer but as a thread.""" + self.finish_request(request, client_address) + self.close_request(request) + def process_request(self, request, client_address): """Start a new thread to process the request.""" import threading - t = threading.Thread(target = self.finish_request, + t = threading.Thread(target = self.process_request_thread, args = (request, client_address)) t.start() diff --git a/Misc/ACKS b/Misc/ACKS index e7400e9e51a..b17219a9508 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -296,6 +296,7 @@ Takahiro Nakayama Travers Naran Fredrik Nehr Chad Netzer +Max Neunhöffer George Neville-Neil Oscar Nierstrasz Hrvoje Niksic diff --git a/Misc/NEWS b/Misc/NEWS index e2e9683344a..e89b789ba13 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -86,6 +86,9 @@ Library which indicates whether output is intended for the header 'Q' encoding. +- The SocketServer.ThreadingMixIn class now closes the request after + finish_request() returns. (Not when it errors out though.) + Tools/Demos - Demo/dns was removed. It no longer serves any purpose; a package