Remove trust-dns when target_os is Android
This commit is contained in:
@@ -26,6 +26,13 @@ matrix:
|
|||||||
- rust: stable
|
- rust: stable
|
||||||
env: FEATURES="--features hyper-011"
|
env: FEATURES="--features hyper-011"
|
||||||
|
|
||||||
|
# android
|
||||||
|
- rust: stable
|
||||||
|
env: TARGET=aarch64-linux-android
|
||||||
|
install: rustup target add "$TARGET"
|
||||||
|
# disable default-tls feature since cross-compiling openssl is dragons
|
||||||
|
script: cargo build --target "$TARGET" --no-default-features
|
||||||
|
|
||||||
# minimum version
|
# minimum version
|
||||||
- rust: 1.30.0
|
- rust: 1.30.0
|
||||||
script: cargo build
|
script: cargo build
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ tokio-executor = "0.1.4" # a minimum version so trust-dns-resolver compiles
|
|||||||
tokio-io = "0.1"
|
tokio-io = "0.1"
|
||||||
tokio-threadpool = "0.1.8" # a minimum version so tokio compiles
|
tokio-threadpool = "0.1.8" # a minimum version so tokio compiles
|
||||||
tokio-timer = "0.2.6" # a minimum version so trust-dns-resolver compiles
|
tokio-timer = "0.2.6" # a minimum version so trust-dns-resolver compiles
|
||||||
trust-dns-resolver = "0.10"
|
|
||||||
url = "1.2"
|
url = "1.2"
|
||||||
uuid = { version = "0.7", features = ["v4"] }
|
uuid = { version = "0.7", features = ["v4"] }
|
||||||
hyper-rustls = { version = "0.15", optional = true }
|
hyper-rustls = { version = "0.15", optional = true }
|
||||||
@@ -39,6 +38,9 @@ tokio-rustls = { version = "0.8", optional = true }
|
|||||||
webpki-roots = { version = "0.15", optional = true }
|
webpki-roots = { version = "0.15", optional = true }
|
||||||
rustls = { version = "0.14", features = ["dangerous_configuration"], optional = true }
|
rustls = { version = "0.14", features = ["dangerous_configuration"], optional = true }
|
||||||
|
|
||||||
|
[target.'cfg(not(target_os = "android"))'.dependencies]
|
||||||
|
trust-dns-resolver = "0.10"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
env_logger = "0.6"
|
env_logger = "0.6"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
|
|||||||
@@ -13,10 +13,14 @@ use bytes::BufMut;
|
|||||||
use std::io;
|
use std::io;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "android"))]
|
||||||
use dns::TrustDnsResolver;
|
use dns::TrustDnsResolver;
|
||||||
use Proxy;
|
use Proxy;
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "android"))]
|
||||||
type HttpConnector = ::hyper::client::HttpConnector<TrustDnsResolver>;
|
type HttpConnector = ::hyper::client::HttpConnector<TrustDnsResolver>;
|
||||||
|
#[cfg(target_os = "android")]
|
||||||
|
type HttpConnector = ::hyper::client::HttpConnector;
|
||||||
|
|
||||||
|
|
||||||
pub(crate) struct Connector {
|
pub(crate) struct Connector {
|
||||||
@@ -70,12 +74,18 @@ impl Connector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "android"))]
|
||||||
fn http_connector() -> ::Result<HttpConnector> {
|
fn http_connector() -> ::Result<HttpConnector> {
|
||||||
TrustDnsResolver::new()
|
TrustDnsResolver::new()
|
||||||
.map(HttpConnector::new_with_resolver)
|
.map(HttpConnector::new_with_resolver)
|
||||||
.map_err(::error::dns_system_conf)
|
.map_err(::error::dns_system_conf)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "android")]
|
||||||
|
fn http_connector() -> ::Result<HttpConnector> {
|
||||||
|
Ok(HttpConnector::new(4))
|
||||||
|
}
|
||||||
|
|
||||||
impl Connect for Connector {
|
impl Connect for Connector {
|
||||||
type Transport = Conn;
|
type Transport = Conn;
|
||||||
type Error = io::Error;
|
type Error = io::Error;
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ extern crate serde_urlencoded;
|
|||||||
extern crate tokio;
|
extern crate tokio;
|
||||||
#[cfg_attr(feature = "default-tls", macro_use)]
|
#[cfg_attr(feature = "default-tls", macro_use)]
|
||||||
extern crate tokio_io;
|
extern crate tokio_io;
|
||||||
|
#[cfg(not(target_os = "android"))]
|
||||||
extern crate trust_dns_resolver;
|
extern crate trust_dns_resolver;
|
||||||
extern crate url;
|
extern crate url;
|
||||||
extern crate uuid;
|
extern crate uuid;
|
||||||
@@ -237,6 +238,7 @@ mod connect;
|
|||||||
mod connect_async;
|
mod connect_async;
|
||||||
mod body;
|
mod body;
|
||||||
mod client;
|
mod client;
|
||||||
|
#[cfg(not(target_os = "android"))]
|
||||||
mod dns;
|
mod dns;
|
||||||
mod into_url;
|
mod into_url;
|
||||||
mod proxy;
|
mod proxy;
|
||||||
|
|||||||
Reference in New Issue
Block a user