chore(deps): mdns-sd 0.21 (ScopedIp addresses)
cc
This commit is contained in:
2 files changed
+6
-2
No files matched your search
@@ -9,7 +9,7 @@ description = "Casting support for QBZ - Chromecast, DLNA"
|
|||||||
rust_cast = "0.21"
|
rust_cast = "0.21"
|
||||||
|
|
||||||
# mDNS discovery
|
# mDNS discovery
|
||||||
mdns-sd = "0.11"
|
mdns-sd = "0.21"
|
||||||
|
|
||||||
# Local HTTP server for media streaming
|
# Local HTTP server for media streaming
|
||||||
tiny_http = "0.12"
|
tiny_http = "0.12"
|
||||||
|
|||||||
@@ -94,7 +94,11 @@ impl DeviceDiscovery {
|
|||||||
.unwrap_or("Unknown")
|
.unwrap_or("Unknown")
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
let ip = pick_ip(info.get_addresses())
|
// mdns-sd 0.21 scopes addresses by interface (ScopedIp);
|
||||||
|
// the pick only ever needed the bare IpAddr.
|
||||||
|
let addrs: std::collections::HashSet<IpAddr> =
|
||||||
|
info.get_addresses().iter().map(|a| a.to_ip_addr()).collect();
|
||||||
|
let ip = pick_ip(&addrs)
|
||||||
.unwrap_or_else(|| "127.0.0.1".to_string());
|
.unwrap_or_else(|| "127.0.0.1".to_string());
|
||||||
|
|
||||||
let device = DiscoveredDevice {
|
let device = DiscoveredDevice {
|
||||||
|
|||||||
Reference in new issue
Block a user