]> granicus.if.org Git - python/commitdiff
Issue #5715: In socketserver, close the server socket in the child process.
authorCharles-François Natali <neologix@free.fr>
Tue, 24 May 2011 16:23:15 +0000 (18:23 +0200)
committerCharles-François Natali <neologix@free.fr>
Tue, 24 May 2011 16:23:15 +0000 (18:23 +0200)
Lib/socketserver.py
Misc/NEWS

index 3d32c3ea1923a6bde9b8dfbe57903e03377011ed..76ac50a619c57e8a66f175cfe415b8b40c0daa85 100644 (file)
@@ -529,10 +529,10 @@ class ForkingMixIn:
                 self.active_children = []
             self.active_children.append(pid)
             self.close_request(request)
-            return
         else:
             # Child process.
             # This must never return, hence os._exit()!
+            self.socket.close()
             try:
                 self.finish_request(request, client_address)
                 os._exit(0)
index 37bbbc19b31bb40139d35f5f4bad706752d441ec..17f933a8ac712f1d4547615ab9376bd103aa7ee8 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -75,6 +75,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #5715: In socketserver, close the server socket in the child process.
+
 - Issue #12124: zipimport doesn't keep a reference to zlib.decompress() anymore
   to be able to unload the module.