Skip to content

Commit

Permalink
awc: gate TlsConnectorService behind any feature that uses it (#3350)
Browse files Browse the repository at this point in the history
  • Loading branch information
asonix committed May 14, 2024
1 parent c1a6388 commit 44f502e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions awc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Minimum supported Rust version (MSRV) is now 1.72.
- Fix warning on 1.78 due to unused TlsConnectorService struct

## 3.4.0

Expand Down
16 changes: 16 additions & 0 deletions awc/src/client/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,14 @@ where

/// service for establish tcp connection and do client tls handshake.
/// operation is canceled when timeout limit reached.
#[cfg(any(
feature = "dangerous-h2c",
feature = "openssl",
feature = "rustls-0_20",
feature = "rustls-0_21",
feature = "rustls-0_22-webpki-roots",
feature = "rustls-0_22-native-roots",
))]
struct TlsConnectorService<Tcp, Tls> {
/// TCP connection is canceled on `TcpConnectorInnerService`'s timeout setting.
tcp_service: Tcp,
Expand All @@ -659,6 +667,14 @@ struct TlsConnectorService<Tcp, Tls> {
timeout: Duration,
}

#[cfg(any(
feature = "dangerous-h2c",
feature = "openssl",
feature = "rustls-0_20",
feature = "rustls-0_21",
feature = "rustls-0_22-webpki-roots",
feature = "rustls-0_22-native-roots",
))]
impl<Tcp, Tls, IO> Service<Connect> for TlsConnectorService<Tcp, Tls>
where
Tcp:
Expand Down

0 comments on commit 44f502e

Please sign in to comment.