From 27352ba0d882bf851523989a0bcf67d4827ca952 Mon Sep 17 00:00:00 2001 From: Revertron Date: Tue, 13 Apr 2021 23:16:09 +0200 Subject: [PATCH] Increased DNS client timeout from 3 second to 10. Changed 1 bootstrap address. --- alfis.toml | 2 +- src/dns/client.rs | 8 +++----- src/dns/resolve.rs | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/alfis.toml b/alfis.toml index 98affd8..c6122bd 100644 --- a/alfis.toml +++ b/alfis.toml @@ -6,7 +6,7 @@ key_file = "default.key" # Network settings [net] # All bootstap nodes -peers = ["test-ip4.alfis.name:4244", "test-ip6.alfis.name:4244", "[300:1251::1]:4244"] +peers = ["test-ip4.alfis.name:4244", "test-ip6.alfis.name:4244", "[300:1251::53]:4244"] # Your node will listen on that address for other nodes to connect listen = "[::]:4244" # Set true if you want your IP to participate in peer-exchange, or false otherwise diff --git a/src/dns/client.rs b/src/dns/client.rs index d81a357..7e6414b 100644 --- a/src/dns/client.rs +++ b/src/dns/client.rs @@ -211,8 +211,7 @@ impl DnsClient for DnsNetworkClient { } } - // Construct a DnsPacket from buffer, skipping the packet if parsing - // failed + // Construct a DnsPacket from buffer, skipping the packet if parsing failed let packet = match DnsPacket::from_buffer(&mut res_buffer) { Ok(packet) => packet, Err(err) => { @@ -265,8 +264,7 @@ impl DnsClient for DnsNetworkClient { } } - // Construct a DnsPacket from buffer, skipping the packet if parsing - // failed + // Construct a DnsPacket from buffer, skipping the packet if parsing failed let packet = match DnsPacket::from_buffer(&mut res_buffer) { Ok(packet) => packet, Err(err) => { @@ -308,7 +306,7 @@ impl DnsClient for DnsNetworkClient { Builder::new() .name("DnsNetworkClient-timeout-thread".into()) .spawn(move || { - let timeout = Duration::seconds(3); + let timeout = Duration::seconds(10); loop { if let Ok(mut pending_queries) = pending_queries_lock.lock() { let mut finished_queries = Vec::new(); diff --git a/src/dns/resolve.rs b/src/dns/resolve.rs index ee0ee29..1c51b20 100644 --- a/src/dns/resolve.rs +++ b/src/dns/resolve.rs @@ -52,7 +52,7 @@ pub trait DnsResolver { } } - for filter in self.get_context().filters.iter() { + for filter in context.filters.iter() { if let Some(packet) = filter.lookup(qname, qtype) { return Ok(packet); }