diff --git a/core/httptools.py b/core/httptools.py index 7727800f..73293d29 100755 --- a/core/httptools.py +++ b/core/httptools.py @@ -52,7 +52,7 @@ directIP = { } # Maximum wait time for downloadpage, if nothing is specified -HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT = config.get_setting('httptools_timeout', default=15) +HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT = config.get_setting('httptools_timeout', default=5) if HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT == 0: HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT = None # Random use of User-Agents, if nad is not specified diff --git a/lib/doh.py b/lib/doh.py index 14ce62a6..feb5e3aa 100644 --- a/lib/doh.py +++ b/lib/doh.py @@ -38,7 +38,7 @@ def query(name, type='A', server=DOH_SERVER, path="/dns-query", fallback=True): try: req = _Request("https://%s%s?name=%s&type=%s" % (server, path, name, type), headers={"Accept": "application/dns-json"}) - content = _urlopen(req).read().decode() + content = _urlopen(req, timeout=2).read().decode() reply = json.loads(content) if "Answer" in reply: diff --git a/resources/settings.xml b/resources/settings.xml index 95a28b0a..6152bcec 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -66,7 +66,7 @@ - +