From 9fcc7f6d7441e04804f0e5edb629a4206b03c8f6 Mon Sep 17 00:00:00 2001 From: 0x676e67 Date: Wed, 7 Aug 2024 23:07:55 +0800 Subject: [PATCH] refactor(client): Add conditional compilation for `interface` field in HttpConnector struct. (#142) --- src/client/legacy/connect/http.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client/legacy/connect/http.rs b/src/client/legacy/connect/http.rs index 6af9e98..f8c9366 100644 --- a/src/client/legacy/connect/http.rs +++ b/src/client/legacy/connect/http.rs @@ -76,6 +76,7 @@ struct Config { reuse_address: bool, send_buffer_size: Option, recv_buffer_size: Option, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] interface: Option, } @@ -179,6 +180,7 @@ impl HttpConnector { reuse_address: false, send_buffer_size: None, recv_buffer_size: None, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] interface: None, }), resolver, @@ -1117,6 +1119,11 @@ mod tests { enforce_http: false, send_buffer_size: None, recv_buffer_size: None, + #[cfg(any( + target_os = "android", + target_os = "fuchsia", + target_os = "linux" + ))] interface: None, }; let connecting_tcp = ConnectingTcp::new(dns::SocketAddrs::new(addrs), &cfg);