mirror of
https://github.com/dkmstr/openuds.git
synced 2025-03-20 06:50:23 +03:00
backported final fixes
This commit is contained in:
parent
3e947e1d82
commit
aa97309db9
@ -66,7 +66,7 @@ class ConfigurationType(typing.NamedTuple):
|
||||
uds_timeout: int
|
||||
uds_verify_ssl: bool
|
||||
|
||||
command_timeout: int
|
||||
command_timeout: float
|
||||
|
||||
secret: str
|
||||
allow: typing.Set[str]
|
||||
@ -140,7 +140,7 @@ def read(
|
||||
uds_token=uds.get('uds_token', 'unauthorized'),
|
||||
uds_timeout=int(uds.get('uds_timeout', '10')),
|
||||
uds_verify_ssl=uds.get('uds_verify_ssl', 'true').lower() == 'true',
|
||||
command_timeout=int(uds.get('command_timeout', '3')),
|
||||
command_timeout=float(uds.get('command_timeout', '3')),
|
||||
secret=secret,
|
||||
allow=set(uds.get('allow', '127.0.0.1').split(',')),
|
||||
use_uvloop=uds.get('use_uvloop', 'true').lower() == 'true',
|
||||
|
@ -197,7 +197,7 @@ class TunnelProtocol(asyncio.Protocol):
|
||||
finally:
|
||||
self.close_connection()
|
||||
|
||||
async def timeout(self, wait: int) -> None:
|
||||
async def timeout(self, wait: float) -> None:
|
||||
"""Timeout can only occur while waiting for a command (or OPEN command ticket)."""
|
||||
try:
|
||||
await asyncio.sleep(wait)
|
||||
@ -207,7 +207,7 @@ class TunnelProtocol(asyncio.Protocol):
|
||||
except asyncio.CancelledError:
|
||||
pass
|
||||
|
||||
def set_timeout(self, wait: int) -> None:
|
||||
def set_timeout(self, wait: float) -> None:
|
||||
"""Set a timeout for this connection.
|
||||
If reached, the connection will be closed.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user