2
0
mirror of https://github.com/jedisct1/encrypted-dns-server synced 2024-11-12 13:10:44 +00:00

Revert "Allow serve_stale to be disabled"

This reverts commit 3b2301dcbf.
This commit is contained in:
Frank Denis 2019-11-24 16:16:36 +01:00
parent 3b2301dcbf
commit df26dddb86
5 changed files with 1 additions and 11 deletions

View File

@ -78,12 +78,6 @@ cache_ttl_min = 3600
cache_ttl_max = 86400
## Temporarily serve cached entries after their TTL expired
## when servers are not responsive.
serve_stale = true
## DNS cache: error TTL
cache_ttl_error = 600

View File

@ -64,7 +64,6 @@ pub struct Config {
pub cache_ttl_min: u32,
pub cache_ttl_max: u32,
pub cache_ttl_error: u32,
pub serve_stale: Option<bool>,
pub user: Option<String>,
pub group: Option<String>,
pub chroot: Option<String>,

View File

@ -41,7 +41,6 @@ pub struct Globals {
pub cache: Cache,
pub cert_cache: Cache,
pub blacklist: Option<BlackList>,
pub serve_stale: bool,
pub anonymized_dns_enabled: bool,
pub anonymized_dns_allowed_ports: Vec<u16>,
pub anonymized_dns_allow_non_reserved_ports: bool,

View File

@ -509,7 +509,6 @@ fn main() -> Result<(), Error> {
let key_cache_capacity = config.dnscrypt.key_cache_capacity;
let cache_capacity = config.cache_capacity;
let serve_stale = config.serve_stale.unwrap_or(true);
let state_file = &config.state_file;
if let Some(secret_key_path) = matches.value_of("import-from-dnscrypt-wrapper") {
@ -657,7 +656,6 @@ fn main() -> Result<(), Error> {
hasher,
cache,
cert_cache,
serve_stale,
blacklist,
anonymized_dns_enabled,
anonymized_dns_allowed_ports,

View File

@ -129,7 +129,7 @@ pub async fn resolve(
globals.varz.upstream_received.inc();
if dns::rcode_servfail(&response) || dns::rcode_refused(&response) {
trace!("SERVFAIL/REFUSED: {}", dns::rcode(&response));
if let (true, Some(cached_response)) = (globals.serve_stale, cached_response) {
if let Some(cached_response) = cached_response {
trace!("Serving stale");
#[cfg(feature = "metrics")]
{