Switch to libmdns for discovery

This commit is contained in:
Sasha Hilton 2019-11-06 16:39:31 +01:00
parent 267c182ff4
commit d91bf573a4
3 changed files with 6 additions and 6 deletions

View file

@ -29,8 +29,8 @@ aes-ctr = "0.3"
block-modes = "0.3" block-modes = "0.3"
dns-sd = { version = "0.1.3", optional = true } dns-sd = { version = "0.1.3", optional = true }
mdns = { git = "https://github.com/plietar/rust-mdns", optional = true } libmdns = { version = "0.2", optional = true }
[features] [features]
default = ["mdns"] default = ["libmdns"]
with-dns-sd = ["dns-sd"] with-dns-sd = ["dns-sd"]

View file

@ -13,7 +13,7 @@ use hyper::{self, Get, Post, StatusCode};
use dns_sd::DNSService; use dns_sd::DNSService;
#[cfg(not(feature = "with-dns-sd"))] #[cfg(not(feature = "with-dns-sd"))]
use mdns; use libmdns;
use num_bigint::BigUint; use num_bigint::BigUint;
use rand; use rand;
@ -218,7 +218,7 @@ pub struct DiscoveryStream {
#[cfg(not(feature = "with-dns-sd"))] #[cfg(not(feature = "with-dns-sd"))]
pub struct DiscoveryStream { pub struct DiscoveryStream {
credentials: mpsc::UnboundedReceiver<Credentials>, credentials: mpsc::UnboundedReceiver<Credentials>,
_svc: mdns::Service, _svc: libmdns::Service,
} }
pub fn discovery( pub fn discovery(
@ -263,7 +263,7 @@ pub fn discovery(
).unwrap(); ).unwrap();
#[cfg(not(feature = "with-dns-sd"))] #[cfg(not(feature = "with-dns-sd"))]
let responder = mdns::Responder::spawn(&handle)?; let responder = libmdns::Responder::spawn(&handle)?;
#[cfg(not(feature = "with-dns-sd"))] #[cfg(not(feature = "with-dns-sd"))]
let svc = responder.register( let svc = responder.register(

View file

@ -24,7 +24,7 @@ extern crate block_modes;
extern crate dns_sd; extern crate dns_sd;
#[cfg(not(feature = "with-dns-sd"))] #[cfg(not(feature = "with-dns-sd"))]
extern crate mdns; extern crate libmdns;
extern crate librespot_core; extern crate librespot_core;
extern crate librespot_playback as playback; extern crate librespot_playback as playback;