From af17d66baf5c60feca71c1ccea3a7f723117a453 Mon Sep 17 00:00:00 2001 From: V0idk <1439808922@qq.com> Date: Mon, 15 May 2023 04:27:00 +0800 Subject: [PATCH] sshtunnel: remove _LOCK (#232) (close #231) see https://github.com/pahaz/sshtunnel/issues/231 --- sshtunnel.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/sshtunnel.py b/sshtunnel.py index 1807264e..f5fdef9e 100644 --- a/sshtunnel.py +++ b/sshtunnel.py @@ -47,7 +47,6 @@ _DAEMON = True #: Use daemon threads in connections _CONNECTION_COUNTER = 1 -_LOCK = threading.Lock() _DEPRECATIONS = { 'ssh_address': 'ssh_address_or_host', 'ssh_host': 'ssh_address_or_host', @@ -253,14 +252,6 @@ def address_to_str(address): return str(address) -def get_connection_id(): - global _CONNECTION_COUNTER - with _LOCK: - uid = _CONNECTION_COUNTER - _CONNECTION_COUNTER += 1 - return uid - - def _remove_none_values(dictionary): """ Remove dictionary keys whose value is None """ return list(map(dictionary.pop, @@ -340,9 +331,6 @@ def _redirect(self, chan): self.request.sendall(data) def handle(self): - uid = get_connection_id() - self.info = '#{0} <-- {1}'.format(uid, self.client_address or - self.server.local_address) src_address = self.request.getpeername() if not isinstance(src_address, tuple): src_address = ('dummy', 12345)