forked from shaba/openuds
Added more info to UDSClient and small typo fixed
This commit is contained in:
parent
e38cd73f30
commit
4be9e9ea69
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user