mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 04:13:28 +01:00
Merge branch 'maint-0.3.3'
This commit is contained in:
commit
52846f728d
7
changes/bug21394.2
Normal file
7
changes/bug21394.2
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
o Minor bugfix (Exit node DNS retries):
|
||||||
|
- Re-attempt timed-out DNS queries 3 times before failure, since our
|
||||||
|
timeout is 5 seconds for them, but clients wait 10-15. Also allow
|
||||||
|
slightly more timeouts per resolver before giving up on it in the
|
||||||
|
case where an exit has multiple resolvers configured. Fixes bug 21394;
|
||||||
|
bugfix on 0.3.1.9.
|
||||||
|
|
19
src/or/dns.c
19
src/or/dns.c
@ -1441,27 +1441,30 @@ configure_nameservers(int force)
|
|||||||
// If we only have one nameserver, it does not make sense to back off
|
// If we only have one nameserver, it does not make sense to back off
|
||||||
// from it for a timeout. Unfortunately, the value for max-timeouts is
|
// from it for a timeout. Unfortunately, the value for max-timeouts is
|
||||||
// currently clamped by libevent to 255, but it does not hurt to set
|
// currently clamped by libevent to 255, but it does not hurt to set
|
||||||
// it higher in case libevent gets a patch for this.
|
// it higher in case libevent gets a patch for this. Higher-than-
|
||||||
// Reducing attempts in the case of just one name server too, because
|
// default maximum of 3 with multiple nameservers to avoid spuriously
|
||||||
// it is very likely to be a local one where a network connectivity
|
// marking one down on bursts of timeouts resulting from scans/attacks
|
||||||
// issue should not cause an attempt to fail.
|
// against non-responding authoritative DNS servers.
|
||||||
if (evdns_base_count_nameservers(the_evdns_base) == 1) {
|
if (evdns_base_count_nameservers(the_evdns_base) == 1) {
|
||||||
SET("max-timeouts:", "1000000");
|
SET("max-timeouts:", "1000000");
|
||||||
SET("attempts:", "1");
|
|
||||||
} else {
|
} else {
|
||||||
SET("max-timeouts:", "3");
|
SET("max-timeouts:", "10");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Elongate the queue of maximum inflight dns requests, so if a bunch
|
// Elongate the queue of maximum inflight dns requests, so if a bunch
|
||||||
// time out at the resolver (happens commonly with unbound) we won't
|
// remain pending at the resolver (happens commonly with Unbound) we won't
|
||||||
// stall every other DNS request. This potentially means some wasted
|
// stall every other DNS request. This potentially means some wasted
|
||||||
// CPU as there's a walk over a linear queue involved, but this is a
|
// CPU as there's a walk over a linear queue involved, but this is a
|
||||||
// much better tradeoff compared to just failing DNS requests because
|
// much better tradeoff compared to just failing DNS requests because
|
||||||
// of a full queue.
|
// of a full queue.
|
||||||
SET("max-inflight:", "8192");
|
SET("max-inflight:", "8192");
|
||||||
|
|
||||||
// Time out after 5 seconds if no reply.
|
// Two retries at 5 and 10 seconds for bind9/named which relies on
|
||||||
|
// clients to handle retries. Second retry for retried circuits with
|
||||||
|
// extended 15 second timeout. Superfluous with local-system Unbound
|
||||||
|
// instance--has its own elaborate retry scheme.
|
||||||
SET("timeout:", "5");
|
SET("timeout:", "5");
|
||||||
|
SET("attempts:","3");
|
||||||
|
|
||||||
if (options->ServerDNSRandomizeCase)
|
if (options->ServerDNSRandomizeCase)
|
||||||
SET("randomize-case:", "1");
|
SET("randomize-case:", "1");
|
||||||
|
Loading…
Reference in New Issue
Block a user