[Python-checkins] r73863 - python/trunk/Lib/SocketServer.py

kristjan.jonsson python-checkins at python.org
Sun Jul 5 22:56:57 CEST 2009


Author: kristjan.jonsson
Date: Sun Jul  5 22:56:57 2009
New Revision: 73863

Log:
http://bugs.python.org/issue6382
close_request() (which can send a socket.shutdown()) must be called by the child process in a forking server.  The parent must merely close the socket handle.

Modified:
   python/trunk/Lib/SocketServer.py

Modified: python/trunk/Lib/SocketServer.py
==============================================================================
--- python/trunk/Lib/SocketServer.py	(original)
+++ python/trunk/Lib/SocketServer.py	Sun Jul  5 22:56:57 2009
@@ -532,17 +532,19 @@
             if self.active_children is None:
                 self.active_children = []
             self.active_children.append(pid)
-            self.close_request(request)
+            request.close() #close socket handle in parent process
             return
         else:
             # Child process.
             # This must never return, hence os._exit()!
             try:
                 self.finish_request(request, client_address)
+                self.close_request(request)
                 os._exit(0)
             except:
                 try:
                     self.handle_error(request, client_address)
+                    self.close_request(request)
                 finally:
                     os._exit(1)
 


More information about the Python-checkins mailing list