summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2010-01-08 16:12:34 +0000
committerSol Jerome <solj@ices.utexas.edu>2010-01-08 16:12:34 +0000
commit1983255ac6aeff374b36de56ce6666e2388cc890 (patch)
tree39b0bbdca3810391a95892b1cc7489161137d7a3 /src/lib
parent5b1b8a05c25fd757c80c43d619a315f665c47d1d (diff)
downloadbcfg2-1983255ac6aeff374b36de56ce6666e2388cc890.tar.gz
bcfg2-1983255ac6aeff374b36de56ce6666e2388cc890.tar.bz2
bcfg2-1983255ac6aeff374b36de56ce6666e2388cc890.zip
SSLServer: Add file descriptor leak fix from 1.0.0 stable branch
Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5664 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/SSLServer.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/SSLServer.py b/src/lib/SSLServer.py
index 2bdb5ea73..ff2b1958c 100644
--- a/src/lib/SSLServer.py
+++ b/src/lib/SSLServer.py
@@ -129,12 +129,16 @@ class SSLServer (SocketServer.TCPServer, object):
def get_request(self):
(sock, sockinfo) = self.socket.accept()
- sock.settimeout(90)
sslsock = ssl.wrap_socket(sock, server_side=True, certfile=self.certfile,
keyfile=self.keyfile, cert_reqs=self.mode,
ca_certs=self.ca, ssl_version=self.ssl_protocol)
return sslsock, sockinfo
+ def close_request(self, request):
+ request.unwrap()
+ request.shutdown(2)
+ request.close()
+
def _get_url(self):
port = self.socket.getsockname()[1]
hostname = socket.gethostname()
@@ -223,9 +227,6 @@ class XMLRPCRequestHandler (SimpleXMLRPCServer.SimpleXMLRPCRequestHandler):
self.wfile.flush()
self.wfile.close()
self.rfile.close()
- self.connection.unwrap()
- self.connection.close()
- os.close(self.connection.fileno())
class XMLRPCServer (SocketServer.ThreadingMixIn, SSLServer,
XMLRPCDispatcher, object):