summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2009-07-05 20:56:57 (GMT)
committerKristján Valur Jónsson <kristjan@ccpgames.com>2009-07-05 20:56:57 (GMT)
commitf5b8ea9128fbafaf60c2de31a314f008819c48aa (patch)
treeda5cda8aa5947ac566e9cba99b699e3ec2329162 /Lib
parent463dc4bf26c37c5f90cfe9328087976a0bdc5757 (diff)
downloadcpython-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.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/SocketServer.py4
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)