Timeout richieste 5 secondi di default, 2 per i DNS

This commit is contained in:
mac12m99
2021-10-29 20:06:30 +02:00
parent d0de267be7
commit cce2e330ba
3 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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:

View File

@@ -66,7 +66,7 @@
<setting id="resolve_priority" type="select" label="70110" lvalues="70164|70165|70166" default="0"/>
<setting id="resolve_stop" type="bool" label="70111" default="true"/>
<setting id="hidepremium" type="bool" label="70112" default="false"/>
<setting id="httptools_timeout" type="slider" option="int" range="0,5,120" label="70580" default="15"/>
<setting id="httptools_timeout" type="slider" option="int" range="0,1,30" label="70580" default="5"/>
<setting label="70145" type="lsep"/>
<setting id="favorites_servers" type="bool" label="60551" default="false" visible="false"/>
<setting id="quality_priority" type="bool" label="30069" default="false" visible="false"/>