summaryrefslogtreecommitdiff
path: root/src/or/dns.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-12-28 21:29:37 +0000
committerNick Mathewson <nickm@torproject.org>2006-12-28 21:29:37 +0000
commit0bbbf98be4eff74218a010a24f5cafe4da7045b6 (patch)
treebb00d6004cdaae2c0e640cbd562ef12df84217bb /src/or/dns.c
parent3996fd1d9dd3e4815a898aa0b9154ea0fab4ec3d (diff)
downloadtor-0bbbf98be4eff74218a010a24f5cafe4da7045b6.tar.gz
tor-0bbbf98be4eff74218a010a24f5cafe4da7045b6.zip
r11727@Kushana: nickm | 2006-12-28 16:27:17 -0500
If we only have a single nameserver, raise the threshold to decide that the nameserver is dead. (Another fumbling attempt to do something about bug 326.) svn:r9203
Diffstat (limited to 'src/or/dns.c')
-rw-r--r--src/or/dns.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/or/dns.c b/src/or/dns.c
index ca1d60c5bd..212068d4bc 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -216,7 +216,7 @@ dns_reset(void)
resolv_conf_mtime = 0;
} else {
if (configure_nameservers(0) < 0)
- /* XXXX */
+ /* XXXX012 */
return;
}
#else
@@ -651,7 +651,7 @@ dns_resolve(edge_connection_t *exitconn, or_circuit_t *oncirc)
log_debug(LD_EXIT,"Connection (fd %d) found cached error for %s",
exitconn->_base.s,
escaped_safe_str(exitconn->_base.address));
- /* XXXX send back indication of failure for connect case? -NM*/
+ /* XXXX012 send back indication of failure for connect case? -NM*/
if (is_resolve)
send_resolved_cell(exitconn, oncirc, RESOLVED_TYPE_ERROR);
circ = circuit_get_by_edge_conn(exitconn);
@@ -853,7 +853,7 @@ add_answer_to_cache(const char *address, int is_reverse, uint32_t addr,
if (outcome == DNS_RESOLVE_FAILED_TRANSIENT)
return;
- /* XXX This is dumb, but it seems to workaround a bug I can't find. We
+ /* XXXX012 This is dumb, but it seems to workaround a bug I can't find. We
* should nail this so we can cache reverse DNS answers. -NM */
if (is_reverse)
return;
@@ -1525,6 +1525,14 @@ configure_nameservers(int force)
}
#endif
+ if (evdns_count_nameservers() == 1) {
+ evdns_set_option("max-timeouts:", "16", DNS_OPTIONS_ALL);
+ evdns_set_option("timeout:", "10", DNS_OPTIONS_ALL);
+ } else {
+ evdns_set_option("max-timeouts:", "3", DNS_OPTIONS_ALL);
+ evdns_set_option("timeout:", "5", DNS_OPTIONS_ALL);
+ }
+
dns_servers_relaunch_checks();
nameservers_configured = 1;