fix addr in wrong place

This commit is contained in:
Sasha Hilton 2018-01-31 12:08:23 +01:00
parent d923f3bad3
commit 7a58e6d561

View file

@ -220,6 +220,9 @@ pub fn discovery(handle: &Handle, config: ConnectConfig, device_id: String)
#[cfg(feature = "with-dns-sd")]
let port = serve.incoming_ref().local_addr().port();
#[cfg(not(feature = "with-dns-sd"))]
let addr = serve.incoming_ref().local_addr();
let server_future = {
let handle = handle.clone();
serve.for_each(move |connection| {
@ -238,10 +241,9 @@ pub fn discovery(handle: &Handle, config: ConnectConfig, device_id: String)
port,
&["VERSION=1.0", "CPath=/"]).unwrap();
#[cfg(not(feature = "with-dns-sd"))]
let addr = serve.incoming_ref().local_addr();
#[cfg(not(feature = "with-dns-sd"))]
let responder = mdns::Responder::spawn(&handle)?;
#[cfg(not(feature = "with-dns-sd"))]
let svc = responder.register(
"_spotify-connect._tcp".to_owned(),