From c0b72f9007db2be36050695fbd1befd7e3c9309f Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 17 Jun 2020 00:42:40 -0500 Subject: [PATCH] handle ping missed in lan connecting --- src/lan/client/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lan/client/__init__.py b/src/lan/client/__init__.py index 81126237..7a156af8 100644 --- a/src/lan/client/__init__.py +++ b/src/lan/client/__init__.py @@ -38,7 +38,8 @@ def _lan_work(peer: LANIP): if identified_port.port != 0: break try: - if requests.get(f'http://{peer}:{i}/ping') == 'onionr!': + if requests.get(f'http://{peer}:{i}/ping', timeout=1) == 'onionr!': + print("Found", peer, i) identified_port.port = i break except requests.exceptions.ConnectionError: