Commit a7cdb0f2 authored by Benjamin Peterson's avatar Benjamin Peterson

generally, sockets should be closed after they're used

parent 7b54e756
...@@ -532,13 +532,14 @@ class ForkingMixIn: ...@@ -532,13 +532,14 @@ class ForkingMixIn:
else: else:
# Child process. # Child process.
# This must never return, hence os._exit()! # This must never return, hence os._exit()!
self.socket.close()
try: try:
self.finish_request(request, client_address) self.finish_request(request, client_address)
self.socket.close()
os._exit(0) os._exit(0)
except: except:
try: try:
self.handle_error(request, client_address) self.handle_error(request, client_address)
self.socket.close()
finally: finally:
os._exit(1) os._exit(1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment