diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-07-05 20:56:57 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-07-05 20:56:57 (GMT) |
commit | f5b8ea9128fbafaf60c2de31a314f008819c48aa (patch) | |
tree | da5cda8aa5947ac566e9cba99b699e3ec2329162 | |
parent | 463dc4bf26c37c5f90cfe9328087976a0bdc5757 (diff) | |
download | cpython-f5b8ea9128fbafaf60c2de31a314f008819c48aa.zip cpython-f5b8ea9128fbafaf60c2de31a314f008819c48aa.tar.gz cpython-f5b8ea9128fbafaf60c2de31a314f008819c48aa.tar.bz2 |
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.
-rw-r--r-- | Lib/SocketServer.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/SocketServer.py b/Lib/SocketServer.py index 08f005b..20b8203 100644 --- a/Lib/SocketServer.py +++ b/Lib/SocketServer.py @@ -532,17 +532,19 @@ class ForkingMixIn: 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) |