Skip to content

Commit 9fcc7f6

Browse files
authored
refactor(client): Add conditional compilation for interface field in HttpConnector struct. (#142)
1 parent cbe098a commit 9fcc7f6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/client/legacy/connect/http.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ struct Config {
7676
reuse_address: bool,
7777
send_buffer_size: Option<usize>,
7878
recv_buffer_size: Option<usize>,
79+
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
7980
interface: Option<String>,
8081
}
8182

@@ -179,6 +180,7 @@ impl<R> HttpConnector<R> {
179180
reuse_address: false,
180181
send_buffer_size: None,
181182
recv_buffer_size: None,
183+
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
182184
interface: None,
183185
}),
184186
resolver,
@@ -1117,6 +1119,11 @@ mod tests {
11171119
enforce_http: false,
11181120
send_buffer_size: None,
11191121
recv_buffer_size: None,
1122+
#[cfg(any(
1123+
target_os = "android",
1124+
target_os = "fuchsia",
1125+
target_os = "linux"
1126+
))]
11201127
interface: None,
11211128
};
11221129
let connecting_tcp = ConnectingTcp::new(dns::SocketAddrs::new(addrs), &cfg);

0 commit comments

Comments
 (0)