Made DoH feature optional to be able to create new builds for MIPSes.

This commit is contained in:
Revertron
2021-09-15 23:56:51 +02:00
parent 6eb185f76a
commit 82ccffbbb7
5 changed files with 50 additions and 15 deletions
+6 -1
View File
@@ -89,7 +89,12 @@ impl DnsResolver for ForwardingDnsResolver {
let result = match self.context.cache.lookup(qname, qtype) {
None => {
if is_url(upstream) {
self.context.doh_client.send_query(qname, qtype, upstream, true)?
if let Some(client) = &self.context.doh_client {
client.send_query(qname, qtype, upstream, true)?
} else {
log::error!("This build doesn't support DoH");
return Err(ResolveError::NoServerFound);
}
} else {
self.context.old_client.send_query(qname, qtype, upstream, true)?
}