diff options
author | Rob Crittenden <rcritten@redhat.com> | 2012-10-17 16:58:54 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2012-10-24 15:07:53 -0400 |
commit | fb7575d6b77c1d85539c8e71b7fa931e758704d3 (patch) | |
tree | d876198c0b025085625f0f84dfd8a665a458f960 /ipapython/nsslib.py | |
parent | 445744206b92787e82057ca56062076ccf9d7dfe (diff) | |
download | freeipa-fb7575d6b77c1d85539c8e71b7fa931e758704d3.tar.gz freeipa-fb7575d6b77c1d85539c8e71b7fa931e758704d3.tar.xz freeipa-fb7575d6b77c1d85539c8e71b7fa931e758704d3.zip |
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
Diffstat (limited to 'ipapython/nsslib.py')
-rw-r--r-- | ipapython/nsslib.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ipapython/nsslib.py b/ipapython/nsslib.py index 06bcba64..7afccd56 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 |