diff --git a/client-py3/full/src/UDSClient.py b/client-py3/full/src/UDSClient.py index 8d8f64cb..816a6f61 100755 --- a/client-py3/full/src/UDSClient.py +++ b/client-py3/full/src/UDSClient.py @@ -128,11 +128,13 @@ class UDSClient(QtWidgets.QMainWindow): self.anim = 0 self.animInverted = False self.ui.progressBar.setInvertedAppearance(self.animInverted) - self.animTimer.start(40) + if self.animTimer: + self.animTimer.start(40) def stopAnim(self): self.ui.progressBar.invertedAppearance = False # type: ignore - self.animTimer.stop() + if self.animTimer: + self.animTimer.stop() def getVersion(self): try: diff --git a/client-py3/full/src/uds/forward.py b/client-py3/full/src/uds/forward.py index 75364860..3b6bf0d7 100644 --- a/client-py3/full/src/uds/forward.py +++ b/client-py3/full/src/uds/forward.py @@ -93,6 +93,7 @@ class Handler(socketserver.BaseRequestHandler): class ForwardThread(threading.Thread): status = 0 # Connecting client: typing.Optional[paramiko.SSHClient] + fs: typing.Optional[ForwardServer] def __init__(self, server, port, username, password, localPort, redirectHost, redirectPort, waitTime, fingerPrints): threading.Thread.__init__(self) @@ -180,7 +181,9 @@ class ForwardThread(threading.Thread): self.timer.cancel() self.stopEvent.set() - self.fs.shutdown() + + if self.fs: + self.fs.shutdown() if self.client is not None: self.client.useCount -= 1 # type: ignore diff --git a/client-py3/full/src/uds/tunnel.py b/client-py3/full/src/uds/tunnel.py index 1f0e4740..7af11ae7 100644 --- a/client-py3/full/src/uds/tunnel.py +++ b/client-py3/full/src/uds/tunnel.py @@ -132,12 +132,15 @@ class ForwardServer(socketserver.ThreadingTCPServer): if self.status == TUNNEL_ERROR: return False + logger.debug('Checking tunnel availability') + try: with self.connect() as ssl_socket: ssl_socket.sendall(HANDSHAKE_V1 + b'TEST') resp = ssl_socket.recv(2) if resp != b'OK': raise Exception({'Invalid tunnelresponse: {resp}'}) + logger.debug('Tunnel is available!') return True except Exception as e: logger.error( @@ -220,7 +223,7 @@ class Handler(socketserver.BaseRequestHandler): if not data: break self.request.sendall(data) - logger.debug('Finished tunnel with ticekt %s', self.server.ticket) + logger.debug('Finished tunnel with ticket %s', self.server.ticket) except Exception as e: pass