Disable trust-dns on Windows

Closes #431
This commit is contained in:
Sean McArthur
2019-01-11 10:48:47 -08:00
parent ed1a6d4614
commit 23e13304ef
4 changed files with 14 additions and 8 deletions

View File

@@ -13,13 +13,13 @@ use bytes::BufMut;
use std::io;
use std::sync::Arc;
#[cfg(not(target_os = "android"))]
#[cfg(not(any(target_os = "android", windows)))]
use dns::TrustDnsResolver;
use Proxy;
#[cfg(not(target_os = "android"))]
#[cfg(not(any(target_os = "android", windows)))]
type HttpConnector = ::hyper::client::HttpConnector<TrustDnsResolver>;
#[cfg(target_os = "android")]
#[cfg(any(target_os = "android", windows))]
type HttpConnector = ::hyper::client::HttpConnector;
@@ -74,14 +74,14 @@ impl Connector {
}
}
#[cfg(not(target_os = "android"))]
#[cfg(not(any(target_os = "android", windows)))]
fn http_connector() -> ::Result<HttpConnector> {
TrustDnsResolver::new()
.map(HttpConnector::new_with_resolver)
.map_err(::error::dns_system_conf)
}
#[cfg(target_os = "android")]
#[cfg(any(target_os = "android", windows))]
fn http_connector() -> ::Result<HttpConnector> {
Ok(HttpConnector::new(4))
}