diff --git a/tunnel-server/src/uds_tunnel/config.py b/tunnel-server/src/uds_tunnel/config.py index da79f9c87..070714099 100644 --- a/tunnel-server/src/uds_tunnel/config.py +++ b/tunnel-server/src/uds_tunnel/config.py @@ -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', diff --git a/tunnel-server/src/uds_tunnel/tunnel.py b/tunnel-server/src/uds_tunnel/tunnel.py index c8336901b..cbf5b1b10 100644 --- a/tunnel-server/src/uds_tunnel/tunnel.py +++ b/tunnel-server/src/uds_tunnel/tunnel.py @@ -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.