diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8890c836..e96c00238 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -219,7 +219,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: check --feature-powerset - run: cargo hack --no-dev-deps check --feature-powerset --depth 2 --skip http3,__tls,__rustls,__rustls-ring,native-tls-vendored,trust-dns + run: cargo hack --no-dev-deps check --feature-powerset --depth 2 --skip http3,http3-no-provider,http3-aws-lc-rs,__tls,__rustls,__rustls-ring,native-tls-vendored,trust-dns env: RUSTFLAGS: "-D dead_code -D unused_imports" @@ -237,7 +237,7 @@ jobs: toolchain: 'stable' - name: Check - run: cargo test --features http3,stream + run: cargo test --features http3,http3-no-provider,http3-aws-lc-rs,stream env: RUSTFLAGS: --cfg reqwest_unstable RUSTDOCFLAGS: --cfg reqwest_unstable diff --git a/Cargo.toml b/Cargo.toml index cf8057f97..e9f2a27d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -91,7 +91,9 @@ system-proxy = ["hyper-util/client-proxy-system"] macos-system-configuration = ["system-proxy"] # Experimental HTTP/3 client. -http3 = ["rustls-tls-manual-roots", "dep:h3", "dep:h3-quinn", "dep:quinn", "tokio/macros"] +http3-no-provider = ["rustls-tls-manual-roots-no-provider", "dep:h3", "dep:h3-quinn", "dep:quinn", "tokio/macros"] +http3 = ["http3-no-provider", "quinn/rustls-ring"] +http3-aws-lc-rs = ["http3-no-provider", "quinn/rustls-aws-lc-rs"] # Internal (PRIVATE!) features used to aid testing. @@ -169,7 +171,7 @@ once_cell = { version = "1.18", optional = true } # HTTP/3 experimental support h3 = { version = "0.0.8", optional = true } h3-quinn = { version = "0.0.10", optional = true } -quinn = { version = "0.11.1", default-features = false, features = ["rustls", "runtime-tokio"], optional = true } +quinn = { version = "0.11.1", default-features = false, features = ["runtime-tokio"], optional = true } futures-channel = { version = "0.3", optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] diff --git a/examples/h3_simple.rs b/examples/h3_simple.rs index 53a2379e5..fafaef985 100644 --- a/examples/h3_simple.rs +++ b/examples/h3_simple.rs @@ -3,7 +3,7 @@ // This is using the `tokio` runtime. You'll need the following dependency: // // `tokio = { version = "1", features = ["full"] }` -#[cfg(feature = "http3")] +#[cfg(feature = "http3-no-provider")] #[cfg(not(target_arch = "wasm32"))] #[tokio::main] async fn main() -> Result<(), reqwest::Error> { @@ -40,5 +40,5 @@ async fn main() -> Result<(), reqwest::Error> { // for wasm32 target, because tokio isn't compatible with wasm32. // If you aren't building for wasm32, you don't need that line. // The two lines below avoid the "'main' function not found" error when building for wasm32 target. -#[cfg(any(target_arch = "wasm32", not(feature = "http3")))] +#[cfg(any(target_arch = "wasm32", not(feature = "http3-no-provider")))] fn main() {} diff --git a/src/async_impl/client.rs b/src/async_impl/client.rs index 1b6fd99ee..54e164ec0 100644 --- a/src/async_impl/client.rs +++ b/src/async_impl/client.rs @@ -13,9 +13,9 @@ use super::decoder::Accepts; use super::request::{Request, RequestBuilder}; use super::response::Response; use super::Body; -#[cfg(feature = "http3")] +#[cfg(feature = "http3-no-provider")] use crate::async_impl::h3_client::connect::{H3ClientConfig, H3Connector}; -#[cfg(feature = "http3")] +#[cfg(feature = "http3-no-provider")] use crate::async_impl::h3_client::H3Client; use crate::config::{RequestConfig, TotalTimeout}; #[cfg(unix)] @@ -54,9 +54,9 @@ use hyper_util::client::legacy::connect::HttpConnector; #[cfg(feature = "default-tls")] use native_tls_crate::TlsConnector; use pin_project_lite::pin_project; -#[cfg(feature = "http3")] +#[cfg(feature = "http3-no-provider")] use quinn::TransportConfig; -#[cfg(feature = "http3")] +#[cfg(feature = "http3-no-provider")] use quinn::VarInt; use tokio::time::Sleep; use tower::util::BoxCloneSyncServiceLayer; @@ -91,7 +91,7 @@ enum HttpVersionPref { Http1, #[cfg(feature = "http2")] Http2, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] Http3, All, } @@ -206,21 +206,21 @@ struct Config { hickory_dns: bool, error: Option, https_only: bool, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] tls_enable_early_data: bool, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] quic_max_idle_timeout: Option, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] quic_stream_receive_window: Option, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] quic_receive_window: Option, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] quic_send_window: Option, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] quic_congestion_bbr: bool, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] h3_max_field_section_size: Option, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] h3_send_grease: Option, dns_overrides: HashMap>, dns_resolver: Option>, @@ -333,21 +333,21 @@ impl ClientBuilder { cookie_store: None, https_only: false, dns_overrides: HashMap::new(), - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] tls_enable_early_data: false, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] quic_max_idle_timeout: None, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] quic_stream_receive_window: None, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] quic_receive_window: None, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] quic_send_window: None, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] quic_congestion_bbr: false, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] h3_max_field_section_size: None, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] h3_send_grease: None, dns_resolver: None, #[cfg(unix)] @@ -378,7 +378,7 @@ impl ClientBuilder { let proxies = Arc::new(proxies); #[allow(unused)] - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] let mut h3_connector = None; let resolver = { @@ -410,7 +410,7 @@ impl ClientBuilder { let mut http = HttpConnector::new_with_resolver(resolver.clone()); http.set_connect_timeout(config.connect_timeout); - #[cfg(all(feature = "http3", feature = "__rustls"))] + #[cfg(all(feature = "http3-no-provider", feature = "__rustls"))] let build_h3_connector = |resolver, tls, @@ -484,7 +484,7 @@ impl ClientBuilder { TlsBackend::Default => { let mut tls = TlsConnector::builder(); - #[cfg(all(feature = "native-tls-alpn", not(feature = "http3")))] + #[cfg(all(feature = "native-tls-alpn", not(feature = "http3-no-provider")))] { match config.http_version_pref { HttpVersionPref::Http1 => { @@ -595,7 +595,7 @@ impl ClientBuilder { ), #[cfg(feature = "__rustls")] TlsBackend::BuiltRustls(conn) => { - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] { h3_connector = build_h3_connector( resolver.clone(), @@ -785,7 +785,7 @@ impl ClientBuilder { HttpVersionPref::Http2 => { tls.alpn_protocols = vec!["h2".into()]; } - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] HttpVersionPref::Http3 => { tls.alpn_protocols = vec!["h3".into()]; } @@ -798,7 +798,7 @@ impl ClientBuilder { } } - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] { tls.enable_early_data = config.tls_enable_early_data; @@ -986,7 +986,7 @@ impl ClientBuilder { cookie_store: config.cookie_store.clone(), // Use match instead of map since config is partially moved, // and it cannot be used in closure - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] h3_client: match h3_connector { Some(h3_connector) => { let h3_service = H3Client::new(h3_connector, config.pool_idle_timeout); @@ -1472,8 +1472,8 @@ impl ClientBuilder { } /// Only use HTTP/3. - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn http3_prior_knowledge(mut self) -> ClientBuilder { self.config.http_version_pref = HttpVersionPref::Http3; self @@ -2199,8 +2199,8 @@ impl ClientBuilder { /// for HTTP/3 connections. /// /// The default is false. - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn tls_early_data(mut self, enabled: bool) -> ClientBuilder { self.config.tls_enable_early_data = enabled; self @@ -2211,8 +2211,8 @@ impl ClientBuilder { /// Please see docs in [`TransportConfig`] in [`quinn`]. /// /// [`TransportConfig`]: https://docs.rs/quinn/latest/quinn/struct.TransportConfig.html - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn http3_max_idle_timeout(mut self, value: Duration) -> ClientBuilder { self.config.quic_max_idle_timeout = Some(value); self @@ -2228,8 +2228,8 @@ impl ClientBuilder { /// # Panics /// /// Panics if the value is over 2^62. - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn http3_stream_receive_window(mut self, value: u64) -> ClientBuilder { self.config.quic_stream_receive_window = Some(value.try_into().unwrap()); self @@ -2245,8 +2245,8 @@ impl ClientBuilder { /// # Panics /// /// Panics if the value is over 2^62. - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn http3_conn_receive_window(mut self, value: u64) -> ClientBuilder { self.config.quic_receive_window = Some(value.try_into().unwrap()); self @@ -2257,8 +2257,8 @@ impl ClientBuilder { /// Please see docs in [`TransportConfig`] in [`quinn`]. /// /// [`TransportConfig`]: https://docs.rs/quinn/latest/quinn/struct.TransportConfig.html - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn http3_send_window(mut self, value: u64) -> ClientBuilder { self.config.quic_send_window = Some(value); self @@ -2271,8 +2271,8 @@ impl ClientBuilder { /// /// [BBR]: https://datatracker.ietf.org/doc/html/draft-ietf-ccwg-bbr /// [CUBIC]: https://datatracker.ietf.org/doc/html/rfc8312 - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn http3_congestion_bbr(mut self) -> ClientBuilder { self.config.quic_congestion_bbr = true; self @@ -2287,8 +2287,8 @@ impl ClientBuilder { /// Please see docs in [`Builder`] in [`h3`]. /// /// [`Builder`]: https://docs.rs/h3/latest/h3/client/struct.Builder.html#method.max_field_section_size - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn http3_max_field_section_size(mut self, value: u64) -> ClientBuilder { self.config.h3_max_field_section_size = Some(value.try_into().unwrap()); self @@ -2305,8 +2305,8 @@ impl ClientBuilder { /// Please see docs in [`Builder`] in [`h3`]. /// /// [`Builder`]: https://docs.rs/h3/latest/h3/client/struct.Builder.html#method.send_grease - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn http3_send_grease(mut self, enabled: bool) -> ClientBuilder { self.config.h3_send_grease = Some(enabled); self @@ -2324,7 +2324,7 @@ impl ClientBuilder { /// ``` /// use std::time::Duration; /// - /// # #[cfg(not(feature = "rustls-tls-no-provider"))] + /// # #[cfg(feature = "rustls-tls")] /// let client = reqwest::Client::builder() /// // resolved to outermost layer, meaning while we are waiting on concurrency limit /// .connect_timeout(Duration::from_millis(200)) @@ -2508,7 +2508,7 @@ impl Client { .version(version); let in_flight = match version { - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] http::Version::HTTP_3 if self.inner.h3_client.is_some() => { let mut req = builder.body(body).expect("valid request parts"); *req.headers_mut() = headers.clone(); @@ -2761,7 +2761,7 @@ impl Config { f.field("dns_overrides", &self.dns_overrides); } - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] { if self.tls_enable_early_data { f.field("tls_enable_early_data", &true); @@ -2791,7 +2791,7 @@ struct ClientRef { cookie_store: Option>, headers: HeaderMap, hyper: LayeredService, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] h3_client: Option>, referer: bool, total_timeout: RequestConfig, @@ -2871,7 +2871,7 @@ pin_project! { enum ResponseFuture { Default(LayeredFuture), - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] H3(LayeredFuture), } @@ -2942,7 +2942,7 @@ impl Future for PendingRequest { } Ok(res) => res.map(super::body::boxed), }, - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] ResponseFuture::H3(r) => match ready!(Pin::new(r).poll(cx)) { Err(e) => { return Poll::Ready(Err(crate::error::request(e).with_url(self.url.clone()))); diff --git a/src/async_impl/h3_client/mod.rs b/src/async_impl/h3_client/mod.rs index 301eb536f..24df65b84 100644 --- a/src/async_impl/h3_client/mod.rs +++ b/src/async_impl/h3_client/mod.rs @@ -1,4 +1,4 @@ -#![cfg(feature = "http3")] +#![cfg(feature = "http3-no-provider")] pub(crate) mod connect; pub(crate) mod dns; diff --git a/src/blocking/client.rs b/src/blocking/client.rs index 255d9d8aa..f1ac4ec93 100644 --- a/src/blocking/client.rs +++ b/src/blocking/client.rs @@ -530,8 +530,8 @@ impl ClientBuilder { /// This requires the optional `http3` feature to be /// enabled. - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(feature = "http3")))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(feature = "http3-no-provider")))] pub fn http3_prior_knowledge(self) -> ClientBuilder { self.with_inner(|inner| inner.http3_prior_knowledge()) } @@ -541,8 +541,8 @@ impl ClientBuilder { /// Please see docs in [`TransportConfig`] in [`quinn`]. /// /// [`TransportConfig`]: https://docs.rs/quinn/latest/quinn/struct.TransportConfig.html - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn http3_max_idle_timeout(self, value: Duration) -> ClientBuilder { self.with_inner(|inner| inner.http3_max_idle_timeout(value)) } @@ -557,8 +557,8 @@ impl ClientBuilder { /// # Panics /// /// Panics if the value is over 2^62. - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn http3_stream_receive_window(self, value: u64) -> ClientBuilder { self.with_inner(|inner| inner.http3_stream_receive_window(value)) } @@ -573,8 +573,8 @@ impl ClientBuilder { /// # Panics /// /// Panics if the value is over 2^62. - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn http3_conn_receive_window(self, value: u64) -> ClientBuilder { self.with_inner(|inner| inner.http3_conn_receive_window(value)) } @@ -584,8 +584,8 @@ impl ClientBuilder { /// Please see docs in [`TransportConfig`] in [`quinn`]. /// /// [`TransportConfig`]: https://docs.rs/quinn/latest/quinn/struct.TransportConfig.html - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn http3_send_window(self, value: u64) -> ClientBuilder { self.with_inner(|inner| inner.http3_send_window(value)) } @@ -597,8 +597,8 @@ impl ClientBuilder { /// /// [BBR]: https://datatracker.ietf.org/doc/html/draft-ietf-ccwg-bbr /// [CUBIC]: https://datatracker.ietf.org/doc/html/rfc8312 - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn http3_congestion_bbr(self) -> ClientBuilder { self.with_inner(|inner| inner.http3_congestion_bbr()) } @@ -612,8 +612,8 @@ impl ClientBuilder { /// Please see docs in [`Builder`] in [`h3`]. /// /// [`Builder`]: https://docs.rs/h3/latest/h3/client/struct.Builder.html#method.max_field_section_size - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn http3_max_field_section_size(self, value: u64) -> ClientBuilder { self.with_inner(|inner| inner.http3_max_field_section_size(value)) } @@ -629,8 +629,8 @@ impl ClientBuilder { /// Please see docs in [`Builder`] in [`h3`]. /// /// [`Builder`]: https://docs.rs/h3/latest/h3/client/struct.Builder.html#method.send_grease - #[cfg(feature = "http3")] - #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))] + #[cfg(feature = "http3-no-provider")] + #[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3-no-provider"))))] pub fn http3_send_grease(self, enabled: bool) -> ClientBuilder { self.with_inner(|inner| inner.http3_send_grease(enabled)) } diff --git a/src/lib.rs b/src/lib.rs index 99a7efc54..bcbc327d9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -247,10 +247,10 @@ //! [cargo-features]: https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-features-section //! [sponsor]: https://seanmonstar.com/sponsor -#[cfg(all(feature = "http3", not(reqwest_unstable)))] +#[cfg(all(feature = "http3-no-provider", not(reqwest_unstable)))] compile_error!( "\ - The `http3` feature is unstable, and requires the \ + The `http3-no-provider` feature is unstable, and requires the \ `RUSTFLAGS='--cfg reqwest_unstable'` environment variable to be set.\ " ); diff --git a/src/retry.rs b/src/retry.rs index a3992e818..ef673e510 100644 --- a/src/retry.rs +++ b/src/retry.rs @@ -283,10 +283,10 @@ fn is_retryable_error(err: &crate::Error) -> bool { return false; }; - #[cfg(not(any(feature = "http3", feature = "http2")))] + #[cfg(not(any(feature = "http3-no-provider", feature = "http2")))] let _err = err; - #[cfg(feature = "http3")] + #[cfg(feature = "http3-no-provider")] if let Some(cause) = err.source() { if let Some(err) = cause.downcast_ref::() { log::trace!("determining if HTTP/3 error {err} can be retried"); diff --git a/src/tls.rs b/src/tls.rs index e14d31008..8ffcc4214 100644 --- a/src/tls.rs +++ b/src/tls.rs @@ -588,14 +588,14 @@ impl fmt::Debug for TlsBackend { #[allow(clippy::derivable_impls)] impl Default for TlsBackend { fn default() -> TlsBackend { - #[cfg(all(feature = "default-tls", not(feature = "http3")))] + #[cfg(all(feature = "default-tls", not(feature = "http3-no-provider")))] { TlsBackend::Default } #[cfg(any( all(feature = "__rustls", not(feature = "default-tls")), - feature = "http3" + feature = "http3-no-provider" ))] { TlsBackend::Rustls diff --git a/tests/client.rs b/tests/client.rs index fce977f69..f80891d34 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -389,7 +389,10 @@ async fn http2_upgrade() { } #[cfg(feature = "default-tls")] -#[cfg_attr(feature = "http3", ignore = "enabling http3 seems to break this, why?")] +#[cfg_attr( + feature = "http3-no-provider", + ignore = "enabling http3 seems to break this, why?" +)] #[tokio::test] async fn test_allowed_methods() { let resp = reqwest::Client::builder() diff --git a/tests/http3.rs b/tests/http3.rs index e8b1023c7..0ab0c5d92 100644 --- a/tests/http3.rs +++ b/tests/http3.rs @@ -1,4 +1,4 @@ -#![cfg(feature = "http3")] +#![cfg(feature = "http3-no-provider")] #![cfg(not(target_arch = "wasm32"))] mod support; @@ -43,7 +43,7 @@ async fn find_free_tcp_addr() -> std::net::SocketAddr { listener.local_addr().unwrap() } -#[cfg(feature = "http3")] +#[cfg(feature = "http3-no-provider")] #[tokio::test] async fn http3_test_failed_connection() { let addr = find_free_tcp_addr().await; @@ -106,7 +106,7 @@ async fn http3_test_failed_connection() { drop(server); } -#[cfg(feature = "http3")] +#[cfg(feature = "http3-no-provider")] #[tokio::test] async fn http3_test_concurrent_request() { let server = server::Http3::new().build(|req| async move { @@ -153,7 +153,7 @@ async fn http3_test_concurrent_request() { drop(server); } -#[cfg(feature = "http3")] +#[cfg(feature = "http3-no-provider")] #[tokio::test] async fn http3_test_reconnection() { use std::error::Error; @@ -222,7 +222,7 @@ async fn http3_test_reconnection() { drop(server); } -#[cfg(all(feature = "http3", feature = "stream"))] +#[cfg(all(feature = "http3-no-provider", feature = "stream"))] #[tokio::test] async fn http3_request_stream() { use http_body_util::BodyExt; @@ -256,7 +256,7 @@ async fn http3_request_stream() { assert_eq!(res.status(), reqwest::StatusCode::OK); } -#[cfg(all(feature = "http3", feature = "stream"))] +#[cfg(all(feature = "http3-no-provider", feature = "stream"))] #[tokio::test] async fn http3_request_stream_error() { use http_body_util::BodyExt; diff --git a/tests/support/server.rs b/tests/support/server.rs index e9b653db4..cec8e9ceb 100644 --- a/tests/support/server.rs +++ b/tests/support/server.rs @@ -149,13 +149,13 @@ where .unwrap() } -#[cfg(feature = "http3")] +#[cfg(feature = "http3-no-provider")] #[derive(Debug, Default)] pub struct Http3 { addr: Option, } -#[cfg(feature = "http3")] +#[cfg(feature = "http3-no-provider")] impl Http3 { pub fn new() -> Self { Self::default()