Commit 652cfb7c authored by Max Kellermann's avatar Max Kellermann

zeroconf: skip initialisation if there is no port

parent 5540fbae
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "zeroconf.h" #include "zeroconf.h"
#include "zeroconf-internal.h" #include "zeroconf-internal.h"
#include "conf.h" #include "conf.h"
#include "listen.h"
#include <glib.h> #include <glib.h>
...@@ -42,6 +43,12 @@ void initZeroconf(void) ...@@ -42,6 +43,12 @@ void initZeroconf(void)
if (!zeroconfEnabled) if (!zeroconfEnabled)
return; return;
if (listen_port <= 0) {
g_warning("No global port, disabling zeroconf");
zeroconfEnabled = false;
return;
}
serviceName = config_get_string(CONF_ZEROCONF_NAME, SERVICE_NAME); serviceName = config_get_string(CONF_ZEROCONF_NAME, SERVICE_NAME);
#ifdef HAVE_AVAHI #ifdef HAVE_AVAHI
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment