From fb7575d6b77c1d85539c8e71b7fa931e758704d3 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Wed, 17 Oct 2012 16:58:54 -0400 Subject: Close connection after each request, avoid NSS shutdown problem. The unit tests were failing when executed against an Apache server in F-18 due to dangling references causing NSS shutdown to fail. https://fedorahosted.org/freeipa/ticket/3180 --- ipapython/nsslib.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ipapython') diff --git a/ipapython/nsslib.py b/ipapython/nsslib.py index 06bcba648..7afccd568 100644 --- a/ipapython/nsslib.py +++ b/ipapython/nsslib.py @@ -238,6 +238,12 @@ class NSSConnection(httplib.HTTPConnection, NSSAddressFamilyFallback): def connect(self): self.connect_socket(self.host, self.port) + def close(self): + """Close the connection to the HTTP server.""" + if self.sock: + self.sock.close() # close it manually... there may be other refs + self.sock = None + def endheaders(self, message=None): """ Explicitly close the connection if an error is returned after the -- cgit