From e0149900a7488ad00cc0de682f9cb963ae8fa2a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Tue, 15 Mar 2022 16:28:13 +0100 Subject: [PATCH] Added protection on broken pipe to tunnel --- tunnel-server/src/uds_tunnel/proxy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tunnel-server/src/uds_tunnel/proxy.py b/tunnel-server/src/uds_tunnel/proxy.py index 7c926774..effb0e98 100644 --- a/tunnel-server/src/uds_tunnel/proxy.py +++ b/tunnel-server/src/uds_tunnel/proxy.py @@ -131,7 +131,10 @@ class Proxy: # Method responsible of proxying requests async def __call__(self, source, address: typing.Tuple[str, int]) -> None: - await self.proxy(source, address) + try: + await self.proxy(source, address) + except Exception as e: + logger.error('Error procesing connection from %s: %s', address, e) async def stats(self, full: bool, source, address: typing.Tuple[str, int]) -> None: # Check valid source ip