Skip to content

Commit

Permalink
refactor(client): Add conditional compilation for interface field i…
Browse files Browse the repository at this point in the history
…n HttpConnector struct. (#142)
  • Loading branch information
0x676e67 authored Aug 7, 2024
1 parent cbe098a commit 9fcc7f6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/client/legacy/connect/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ struct Config {
reuse_address: bool,
send_buffer_size: Option<usize>,
recv_buffer_size: Option<usize>,
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
interface: Option<String>,
}

Expand Down Expand Up @@ -179,6 +180,7 @@ impl<R> HttpConnector<R> {
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,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9fcc7f6

Please sign in to comment.