redox/recipes/wip/net/http/miniserve/redox.patch
2026-06-07 09:09:20 +07:00

35 lines
1.2 KiB
Diff

diff --git a/Cargo.toml b/Cargo.toml
index 8349e40..f4eab7f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -39,7 +39,6 @@ futures = "0.3"
grass = { version = "0.13", features = ["macro"], default-features = false }
hex = "0.4"
httparse = "1"
-if-addrs = "0.15"
libflate = "2"
log = "0.4"
maud = "0.27"
@@ -62,6 +61,9 @@ thiserror = "2"
tokio = { version = "1.47.1", features = ["fs", "macros"] }
zip = { version = "8", default-features = false }
+[target.'cfg(not(target_os = "redox"))'.dependencies]
+if-addrs = "0.15"
+
[features]
default = ["tls"]
# This feature allows us to use rustls only on architectures supported by ring.
diff --git a/src/main.rs b/src/main.rs
index b26a3e0..13fe122 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -193,6 +193,7 @@ async fn run(miniserve_config: MiniserveConfig) -> Result<(), StartupError> {
.partition(|addr| !addr.is_unspecified());
// Replace wildcard addresses with local interface addresses
+ #[cfg(not(target_os="redox"))]
if !wildcard.is_empty() {
let all_ipv4 = wildcard.iter().any(|addr| addr.is_ipv4());
let all_ipv6 = wildcard.iter().any(|addr| addr.is_ipv6());