From 839fa2e4811eae9992829dd46f42bb1780281abf Mon Sep 17 00:00:00 2001 From: drebs Date: Tue, 30 Jun 2015 16:40:09 -0300 Subject: [feature] add close() method to client http target HTTP client cached connections will hang around in the reactor if they are not properly cleaned up, and might raise a "reactor unclean" message on shutdown. This commit adds a close() method to the client http target that will cleanup those connections. --- client/src/leap/soledad/client/http_target.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'client/src') diff --git a/client/src/leap/soledad/client/http_target.py b/client/src/leap/soledad/client/http_target.py index 30590ae1..ac078f39 100644 --- a/client/src/leap/soledad/client/http_target.py +++ b/client/src/leap/soledad/client/http_target.py @@ -75,8 +75,6 @@ class SoledadHTTPSyncTarget(SyncTarget): :param source_replica_uid: The source replica uid which we use when deferring decryption. :type source_replica_uid: str - :param url: The url of the target replica to sync with. - :type url: str :param creds: A dictionary containing the uuid and token. :type creds: creds :param crypto: An instance of SoledadCrypto so we can encrypt/decrypt @@ -98,7 +96,7 @@ class SoledadHTTPSyncTarget(SyncTarget): """ if url.endswith("/"): url = url[:-1] - self._url = str(url) + "/sync-from/" + source_replica_uid + self._url = str(url) + "/sync-from/" + str(source_replica_uid) self.source_replica_uid = source_replica_uid self._auth_header = None self.set_creds(creds) @@ -111,6 +109,9 @@ class SoledadHTTPSyncTarget(SyncTarget): self._sync_decr_pool = None self._http = HTTPClient(cert_file) + def close(self): + self._http.close() + def set_creds(self, creds): """ Update credentials. -- cgit v1.2.3