Skip to content

Commit

Permalink
sshtunnel: remove _LOCK (#232) (close #231)
Browse files Browse the repository at this point in the history
see #231
  • Loading branch information
V0idk authored May 14, 2023
1 parent ba25626 commit af17d66
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions sshtunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit af17d66

Please sign in to comment.