From 43e4035df5c75d732adcb91a2f0005f393b79a69 Mon Sep 17 00:00:00 2001 From: John Smith Date: Wed, 15 Jun 2022 21:51:02 -0400 Subject: [PATCH] flutter work --- veilid-core/src/intf/native/system.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/veilid-core/src/intf/native/system.rs b/veilid-core/src/intf/native/system.rs index 60baa83e..56a27a43 100644 --- a/veilid-core/src/intf/native/system.rs +++ b/veilid-core/src/intf/native/system.rs @@ -3,7 +3,7 @@ use crate::xx::*; pub use async_executors::JoinHandle; use async_executors::{AsyncStd, LocalSpawnHandleExt, SpawnHandleExt}; -use async_std_resolver::{config, resolver, AsyncStdResolver}; +use async_std_resolver::{config, resolver, resolver_from_system_conf, AsyncStdResolver}; use rand::prelude::*; use std::time::{Duration, SystemTime, UNIX_EPOCH}; @@ -133,12 +133,15 @@ async fn get_resolver() -> Result { if let Some(r) = &*resolver_lock { Ok(r.clone()) } else { - let resolver = resolver( - config::ResolverConfig::default(), - config::ResolverOpts::default(), - ) - .await - .expect("failed to connect resolver"); + let resolver = match resolver_from_system_conf().await { + Ok(v) => v, + Err(_) => resolver( + config::ResolverConfig::default(), + config::ResolverOpts::default(), + ) + .await + .expect("failed to connect resolver"), + }; *resolver_lock = Some(resolver.clone()); Ok(resolver)