mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
fixed bad ssl handshake management
This commit is contained in:
parent
2c77d361d7
commit
084e0cc2a0
@ -97,6 +97,9 @@ class Proxy:
|
|||||||
logger.error('ERROR on %s:%s: %s', src_ip, src_port, e)
|
logger.error('ERROR on %s:%s: %s', src_ip, src_port, e)
|
||||||
if tun:
|
if tun:
|
||||||
tun.close_connection()
|
tun.close_connection()
|
||||||
|
# Also, ensure socket is closed
|
||||||
|
if source:
|
||||||
|
del source
|
||||||
|
|
||||||
logger.debug('Proxy finished')
|
logger.debug('Proxy finished')
|
||||||
|
|
||||||
|
@ -275,10 +275,12 @@ class TunnelProtocol(asyncio.Protocol):
|
|||||||
def close_connection(self):
|
def close_connection(self):
|
||||||
try:
|
try:
|
||||||
self.clean_timeout() # If a timeout is set, clean it
|
self.clean_timeout() # If a timeout is set, clean it
|
||||||
if not self.transport.is_closing():
|
if not self.transport.is_closing(): # Attribute may alreade not be set
|
||||||
self.transport.close()
|
self.transport.close()
|
||||||
except Exception: # nosec: best effort
|
except AttributeError: # not initialized transport, fine...
|
||||||
pass # Ignore errors
|
pass
|
||||||
|
except Exception as e: # nosec: best effort
|
||||||
|
logger.error('ERROR closing connection: %s', e)
|
||||||
|
|
||||||
def notify_end(self):
|
def notify_end(self):
|
||||||
if self.notify_ticket:
|
if self.notify_ticket:
|
||||||
|
Loading…
Reference in New Issue
Block a user